When the Highlight Matching Search Keywords in Articles setting is enabled, Document360 automatically highlights the search term wherever it appears in an article. The default highlight color is yellow. You can override this with a custom color, for example, to match your brand palette or improve contrast, for both Light and Dark modes.
When to use this
Use this customization when you want to:
- Replace the default yellow highlight with a color that fits your brand or site theme.
- Improve the visibility of search term highlights against your knowledge base background color.
- Apply consistent highlight styling in both Light and Dark modes.
Before you begin
- The Highlight Matching Search Keywords in Articles setting must be enabled for search highlights to appear at all. Enable it under Settings () > Knowledge base site > Site customization before applying this CSS.
- You need access to Settings () > Knowledge base site > Site customization > Custom CSS & JavaScript in the Knowledge base portal.
How to change the search keyword highlight color
-
Navigate to Settings (
) > Knowledge base site > Site customization > Custom CSS & JavaScript in the Knowledge base portal.
-
From the left navigation pane, select the CSS tab and paste the following snippet:
.fp-search-content em, .search-content em {
background-color: #4E1E66;
color: white;
}
In the sample snippets above, green and purple are used as example highlight colors with white text. Replace these with your desired color values.
-
Update the
background-colorandcolorvalues to your desired colors. -
Click Save.

Outcome
Before
Search keywords are highlighted with the default yellow color provided by Document360.

After
Search keywords are highlighted with the custom background color #4E1E66 and white text after applying the CSS.

Troubleshooting: highlighted text in headings appears at the wrong size
Symptom
When an article is opened from a search result or via Eddy AI, a highlighted keyword inside a heading appears smaller than the rest of the heading, at body-text size instead of matching the heading’s size and weight. The article looks correct when opened directly without a highlight query parameter.
Cause
Document360 applies search highlights using em elements nested inside span elements within article content. If your custom CSS contains a rule that sets an explicit font-size on the selector site-document .main-content span, that rule also applies to the highlighted em elements inside headings, overriding the heading’s natural font size.
How to identify the conflict
Review your Custom CSS for a rule that includes site-document .main-content span in its selector list alongside a font-size property.
For example:
@media screen and (min-width: 601px) {
site-document .main-content p,
site-document .main-content a,
site-document .main-content span,
site-document .main-content ul,
site-document .main-content ol,
site-document .main-content div {
font-size: 16px !important;
line-height: 25px;
color: var(--color-gray) !important;
}
}
How to fix it
Remove site-document .main-content span from that selector. Using the example above, the corrected rule is:
@media screen and (min-width: 601px) {
site-document .main-content p,
site-document .main-content a,
site-document .main-content ul,
site-document .main-content ol,
site-document .main-content div {
font-size: 16px !important;
line-height: 25px;
color: var(--color-gray) !important;
}
}
After saving the updated CSS, open an article from a search result. The highlighted keyword in headings should now display at the correct heading size and weight.
Review all properties set on the site-document .main-content span selector - not just font-size and consider whether applying each property to em elements inside headings is intentional. If you need to style inline span elements within body text only, use a more specific selector that excludes headings.
Best practices
- Choose a highlight color that contrasts with both your page background and your text. A highlight color that blends into the background is invisible; one that clashes with the text color reduces readability. Test your chosen combination in both Light and Dark modes.
- Keep text color (
color) in sync with your highlight background. The snippet sets both the highlight background (background-color) and the text color (color) inside the highlight. If you change the background to a dark color, usewhitefor the text. If you use a light background, use a dark text color. - Use HEX or RGB values rather than color names. CSS color names like
greenare imprecise. Replace them with your specific HEX code for accurate and brand-consistent results. - Verify the Highlight Matching Search Keywords setting is enabled. If highlights do not appear after applying the CSS, check that the feature is enabled. The CSS change only affects the color — it cannot activate the feature itself.