Custom CSS
How to style the widget with your own CSS, with the full list of class names and variables you can rely on.
When themes and colors aren't enough, you can write your own CSS for the widget. You'll find the Custom CSS field on the Widget screen, in the Advanced section. It is available on the Advanced personalization level, which comes with the Professional plan. The Widget personalization article explains what each plan includes.
How your CSS is applied
The widget runs in its own isolated part of the page. Your CSS is applied only inside the widget, so it can't change anything else on your site, and your site's own stylesheets don't reach into the widget either.
Styles are applied in this order, and each step overrides the one before:
- the theme,
- the primary color and the text color on primary,
- advanced colors set for individual elements,
- your custom CSS.
Your CSS is added last, and the theme and the advanced colors are written so
they never outrank it. Any rule of yours with at least one class selector,
such as .fibly-header or .fibly-root, wins over the theme and over the
advanced colors. You don't need longer selectors to beat a theme.
The live preview on the settings page applies your CSS as you type, so you can check the result before saving.
Limits
- The CSS can be at most 20 KB.
@importis not allowed. To change the typeface, use the Font setting instead.- The CSS can't contain a closing
</style>tag.
The dashboard shows an error and won't save CSS that breaks one of these rules.
Class names
Every main element of the widget carries a class starting with fibly-.
Use these classes in your selectors rather than other class names you might
find in the page source, which can change at any time.
| Class | Element |
|---|---|
.fibly-launcher | The chat button shown on your page when the widget is collapsed. |
.fibly-launcher-icon | The icon or image inside the chat button. |
.fibly-panel | The open chat window as a whole. |
.fibly-header | The header bar at the top of the chat window. |
.fibly-header-title | The chat window title inside the header. |
.fibly-avatar | The icon or avatar image in the header. |
.fibly-header-actions | The group of buttons on the right side of the header. |
.fibly-messages | The scrolling area that holds the conversation. |
.fibly-message | Every message row in the conversation. |
.fibly-message--bot | A message from the bot. |
.fibly-message--customer | A message from the visitor. |
.fibly-message--agent | A message from a member of your team. |
.fibly-message--event | A conversation event, such as a team member joining, shown as centered text. |
.fibly-bubble | The bubble that holds the text of a bot, visitor or team message. |
.fibly-typing | The indicator shown while a reply is being written. |
.fibly-composer | The area at the bottom with the message field and the send button. |
.fibly-input | The message field. |
.fibly-send | The send button. |
.fibly-footer | The "Powered by Fibly AI" line. It isn't rendered when the footer is hidden. |
.fibly-alert | Every notice shown inside the conversation. |
.fibly-welcome-notice | The welcome notice you set in Widget settings, shown at the start of each conversation. |
.fibly-alert-box | The colored box inside a notice, with its icon and text. |
.fibly-alert--info | The box of an informational notice. |
.fibly-alert--warning | The box of a warning notice. |
.fibly-sales-popup | The speech bubble that can appear next to the collapsed chat button. |
Some elements carry more than one class:
- The typing indicator is displayed as a bot message, so it has
.fibly-message--botas well as.fibly-typing. A rule for.fibly-message--botalso changes the typing indicator. To leave it out, use.fibly-message--bot:not(.fibly-typing). - The welcome notice is also a notice, so it has both
.fibly-welcome-noticeand.fibly-alert. Other notices have only.fibly-alert, even when they appear before the visitor's first message. In conversations that started before this class was introduced, the welcome notice has only.fibly-alert.
Variables
Colors, corners and shadows are defined as CSS variables. Changing a variable is often simpler than overriding individual rules, because every element that uses it changes at once. The defaults below are the values of the Default theme; other themes change some of them.
| Variable | What it controls | Default |
|---|---|---|
--fibly-font | The typeface of all text in the widget. | the system font |
--fibly-surface | The background of the chat window. | #ffffff |
--fibly-panel-bg | The background of the conversation area and the footer. | #f9fafb |
--fibly-header-bg | The header background. | your primary color |
--fibly-header-text | The header text and icons. | your text color on primary |
--fibly-bot-bubble-bg | The background of bot and team messages. | #ffffff |
--fibly-bot-bubble-text | The text of bot and team messages. | #374151 |
--fibly-bot-bubble-border | The border of bot and team messages. | #f3f4f6 |
--fibly-customer-bubble-bg | The background of the visitor's messages. | your primary color |
--fibly-customer-bubble-text | The text of the visitor's messages. | your text color on primary |
--fibly-input-bg | The background of the message field. | transparent |
--fibly-input-text | The text in the message field. | inherit |
--fibly-link | Links inside messages. | blue |
--fibly-muted-text | Secondary text, such as the footer and conversation events. | #9ca3af |
--fibly-border-color | The border of the chat window and the lines above and below the message field. | #e5e7eb |
--fibly-border-width | The width of the chat window's border. | 1px |
--fibly-radius | The corner rounding of the chat window. | 8px |
--fibly-bubble-radius | The corner rounding of message bubbles. | 8px |
--fibly-control-radius | The corner rounding of the message field and the send button. | 6px |
--fibly-launcher-radius | The corner rounding of the chat button. Not set by default: the button is then slightly rounded when it shows text and round when it shows only an icon. A value you set applies to both. | not set |
--fibly-shadow | The shadow of the chat window. | a soft, large shadow |
--fibly-bubble-shadow | The shadow of message bubbles. | a very light shadow |
--fibly-launcher-shadow | The shadow of the chat button. | a soft shadow |
--fibly-alert-info-bg | The background of informational notices. | #eff6ff |
--fibly-alert-info-border | The border of informational notices. | #bfdbfe |
--fibly-alert-info-text | The text and icon of informational notices. | #1d4ed8 |
--fibly-alert-warning-bg | The background of warnings. | #fffbeb |
--fibly-alert-warning-border | The border of warnings. | #fde68a |
--fibly-alert-warning-text | The text and icon of warnings. | #b45309 |
--fibly-alert-radius | The corner rounding of notices. | the same as --fibly-bubble-radius |
--fibly-alert-border-width | The width of the border of notices. | 1px |
--fibly-alert-shadow | The shadow of notices. | none |
Set variables on .fibly-root to change them for the whole widget. A value
you set there wins over the theme and over the advanced colors. To change a
variable in one place only, set it on that element instead, for example on
.fibly-panel for the chat window or on .fibly-launcher for the chat
button.
Examples
A larger header title
.fibly-header-title {
font-size: 18px;
font-weight: 600;
}
Square message bubbles
.fibly-root {
--fibly-bubble-radius: 0;
}
This changes the bubbles of the bot, the visitor and your team at once. To square only the visitor's messages, target them directly:
.fibly-message--customer .fibly-bubble {
border-radius: 0;
}
A custom link color
.fibly-root {
--fibly-link: #0b7a53;
}
If you only want to change the link color, the Links field in Advanced colors does the same without any CSS.
Stable class names and variables
The classes and variables listed on this page are a fixed part of the widget, and we keep them working when the widget changes. If we ever need to rename or remove one, we'll announce it in advance so you have time to update your CSS. Other class names that appear in the page source are internal and can change without notice, so don't rely on them.
After a plan change
If you move to a plan without the Advanced level, your CSS stays saved but isn't applied on your site. It is applied again as soon as you return to a plan that includes it.