Match Your Theme Colours With CSS Variables

You can match your theme colours by setting six CSS variables. There are no colour settings in the plugin, so all of this goes in your theme's CSS or under Appearance > Customize > Additional CSS.

The variables

VariableUsed forDefault
--exactfind-accentButton background, and the visitor's messages in chat#1d4ed8
--exactfind-accent-textText on the accent colour#fff
--exactfind-borderBorders on the input and the widget panel#d1d5db
--exactfind-mutedThe disclaimer text#6b7280
--exactfind-surfaceBackground of the floating widget panel#fff
--exactfind-textText in the search boxInherited from your theme

Copy this example

.exactfind,
.exactfind-float {
	--exactfind-accent: #0f766e;
	--exactfind-accent-text: #fff;
	--exactfind-border: #cbd5e1;
	--exactfind-muted: #64748b;
	--exactfind-surface: #fff;
	--exactfind-text: #1e293b;
}

Set the variables on .exactfind and .exactfind-float, as shown. The plugin's defaults are written so your theme wins, whichever stylesheet loads last. Setting them on the plugin's own elements also beats any general rules in your theme.

Always set --exactfind-text if you change --exactfind-surface. The widget panel has its own dark text, so a dark panel needs a light text colour.

Search box with custom theme colours beside the default colours

Dark mode

If your theme follows the visitor's device setting:

@media (prefers-color-scheme: dark) {
	.exactfind,
	.exactfind-float {
		--exactfind-accent: #2dd4bf;
		--exactfind-accent-text: #042f2e;
		--exactfind-border: #475569;
		--exactfind-muted: #94a3b8;
		--exactfind-surface: #0f172a;
		--exactfind-text: #e2e8f0;
	}
}

If your theme uses a switch instead, put the same variables under the selector it uses, such as .dark .exactfind. Check both modes, including the question box, which takes its colours from your theme.

Class names

Use these to target parts of the search box from your theme.

ClassElement
.exactfindThe search box
.exactfind__welcomeThe welcome text
.exactfind__formThe form around the question box and button
.exactfind__labelThe label around the question box
.exactfind__inputThe question box
.exactfind__buttonThe ask button
.exactfind__resultThe area that holds answers
.exactfind__answerAn answer
.exactfind__sourcesSource links
.exactfind__disclaimerThe disclaimer

Floating widget

ClassElement
.exactfind-floatThe widget, which holds the button and the panel
.exactfind-float--left or .exactfind-float--rightThe corner it sits in
.exactfind-float__toggleThe widget button
.exactfind-float__panelThe panel that opens
.exactfind-challengeThe Turnstile check, when bot protection is on

Chat, with Knowledge

ClassElement
.exactfind--topA chat with the input at the top
.exactfind--bottomA chat with the input at the bottom
.exactfind__threadThe conversation
.exactfind__turnOne question and its answer
.exactfind__message--userThe visitor's question
.exactfind__suggestedThe row of suggested questions
.exactfind__chipA suggested question, and the Yes and No buttons
.exactfind__newThe New chat button
.exactfind__feedbackThe "Was this helpful?" row
.exactfind__talkThe Talk to a person button
.exactfind__handoff-offerThe offer to talk to a person under an answer
.exactfind__handoffThe hand-off form
.exactfind__handoff-doneThe message after a hand-off is sent

See Choose a Chat Layout That Suits Your Page for how the two layouts behave.

What not to change

Change colours, fonts, spacing and borders. Leave the layout to the plugin.

  • Don't change the markup. The chat and widget scripts look for these elements, so moving or replacing them can stop the search box working.
  • Don't move the widget with CSS. Its corner and distances come from Settings > Display, which sets --exactfind-float-x and --exactfind-float-y. Change the setting instead.
  • Don't give the widget panel a fixed height when the chat has the input at the bottom. The plugin works out the panel and conversation heights from the screen height, so the conversation scrolls and the question box stays in view.

Clear caches after a change

After a change, clear your page cache and any CSS optimisation plugin. If an optimisation plugin removes unused CSS, read Use Caching and Optimisation Plugins With ExactFind first, because it can strip the chat styles.

Was this helpful?

Still stuck?

Tell us what you were trying to do and what happened. We reply by email.