--- title: Styling slug: '423' canonical_url: https://docs.coveo.com/en/423/ collection: javascript-search-framework source_format: adoc --- # Styling To visually change how the Coveo JavaScript Search Framework is displayed, style it using standard CSS rules (see [CSS documentation](https://developer.mozilla.org/en-US/docs/Web/CSS)). The Coveo JavaScript Search Framework doesn't offer any special way to change its styling. However, the following tips can help you when adding custom style rules: * All Coveo components have a class that starts with `Coveo` followed by the component name. You can find a list of all the components in the JavaScript Search reference documentation (see [Coveo JavaScript Search Framework - Reference Documentation](https://coveo.github.io/search-ui/globals.html)). * The default styling is available in the JavaScript Search GitHub project, in the `sass` file (see [Coveo JavaScript Search UI Framework](https://github.com/coveo/search-ui)). The CSS is written using Sass (see [Sass](http://sass-lang.com/)). * You're strongly discouraged from changing the `css` files that come out of the box with the Coveo JavaScript Search Framework, as they can be overwritten when upgrading. Instead, you're encouraged to create your own files and reference them in your search page. * As a leading practice, you should add a class to your CoveoSearchInterface component: ```xml
``` This allows you to be more precise when adding CSS rules: ```css .MyCustomClass.CoveoSearchInterface { /* This CSS rule will only be applied to one specific CoveoSearchInterface. Also, since it's narrower, it will easily override the default CoveoSearchInterface css. */ } .MyCustomClass .CoveoFacet { /* The same principle applies to all the Coveo components inside that search interface. */ } ``` ## Customizing SVG icons All icons in the Coveo JavaScript Search Framework are SVG (see [SVG: Scalable Vector Graphics](https://developer.mozilla.org/en-US/docs/Web/SVG)). You can easily customize or replace these icons using your own CSS rules. ### Styling the default icons To achieve a great looking integration with the Coveo JavaScript Search Framework, you may need to modify the default SVG icons. It's possible to alter any visual aspect of an SVG (color, size, hover effect, etc.) using CSS rules. All Coveo JavaScript Search Framework SVG icons (except for the result file type SVG icons, which are displayed by the `ResultList` component) are inlined in the HTML. This gives you maximum control over the SVG styling, and allows you to inspect the HTML of your page to see how each SVG is built, and what style is currently being applied to it, so that you can customize it to better suit your needs. Each SVG and its container has a CSS class that you can use to override the default styling. Some icons, such as the ones that have a hover effect, have extra CSS classes on their inner SVG elements to allow for more customization. Remember that in order to correctly override the default styles, you must achieve higher CSS specificity (see [Specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity)). **Example** Suppose you want to style the default `SearchButton` icon (the magnifier icon) in your search page to make it red. If you inspect this icon, you can see that its markup currently looks like this: ```html ``` Most Coveo JavaScript Search Framework SVG icons have their `fill` attribute set to the `currentColor` value to determine their color. When this is the case, you can change the color of the SVG by setting its `color` property. In this case, since the SVG element you want to modify has the `coveo-search-button-svg` CSS class, you can use this class to override the default color styling: ```css .CoveoSearchButton .coveo-search-button-svg { color: red; } ``` You could also want to modify the hover effect on the `SearchButton` icon. By default, the circle of the magnifier becomes yellow. Suppose you want it to become black instead. SVG icons are built using `