Fonts are an important part of a website’s branding. They control how the text on your Search experience is rendered. Although Search will default to system-available fonts, you can update the fonts on your experience through CSS to make it more in line with your brand’s fonts.
Not all operating systems automatically have all fonts downloaded, so we need a way to make sure a browser is able to access the fonts on your site, rather than using a font available on their computer system. To learn how to do this, view the Add Web Fonts to Search Frontend Theme help article and follow the directions before going through the below steps.
For additional details on fonts and font properties, see the Fonts reference doc.
To use or update a font in Search:
- Click Pages in the navigation bar and click on your desired site.
- Click on the View Code Editor button.
- Hover over the master branch and click on the pencil icon () that appears.
- Click on the
static
folder. - Click on the
scss
folder. - This process differs depending on if you would like to set the font for all Search components or if you would like to target specific classes. Follow the steps below accordingly:
- All Search Components
- Click on the
fonts.scss
file. - Add the font name to the beginning of the
--yxt-font-family
variable:
--yxt-font-family: "Roboto Mono", Arial, Helvetica, sans-serif;
- Click on the
- Target Specific Classes
- Click on the
answers.scss
file. - For the class you would like to target, use
font-family
, and include the web font name you would like to add.
.yxt-SearchBar-title
{
font-family: "Roboto Mono", Arial, Helvetica, sans-serif;
} - Click on the
- All Search Components
Comments
0 comments
Article is closed for comments.