Override theming for AI Search in Service Portal to comply with your company branding.

Before you begin

Role required: sp_admin or admin

About this task

As an example of styling features of AI Search in Service Portal, this procedure removes the borders around the search results container and search filters and changes the hit highlight color. You can style several other features using additional CSS variables. For more information about these variables, see Theming for AI Search in Service Portal.

Search results container: Remove the line border around each item retrieved in the search.

Search results container.

Search filters: Remove the line border around search filters.

Search filters.

Hit highlight color: Change the color displaying the search hit on the text searched.

Hit highlights.

Procedure

  1. Create a style sheet record.
    1. Enter sp_css.do in the Filter navigator.
    2. On the form, fill in the fields.
      Table 1. Style Sheet form
      Field Description
      Name Unique name for your style sheet. For example, sp_ais.css.
      CSS Script field for your CSS script. Enter this script and then customize the variables.
      • To remove the border for the search results container, paste this script and customize as desired.

        sn-search-results-container  {
          --now-container--border-width: 0px !important;
          --mv9-JvmzrAmtZ--kvZptZ-9Apz8: 0px !important;
          --mv9-jvmzramtz--kvzptz-9apz8: 0px !important;
        }
        
      • To remove the border for search filters, paste this script as customize as desired.

        sn-search-facets {
          --now-color--divider-tertiary: 0px !important;
        }
      • To change the hit highlight colors, enter in script the desired rgb color.

        sn-search-results-container, sn-search-combobox {
          --now-color_alert--warning-1: rgb(40,103,178) !important;
        }
      The script should look like this with your customizations included when you're done.
      sn-search-results-container  {
        --now-container--border-width: 0px !important;
        --mv9-JvmzrAmtZ--kvZptZ-9Apz8: 0px !important;
        --mv9-jvmzramtz--kvzptz-9apz8: 0px !important;
      }
       
      sn-search-facets {
        --now-color--divider-tertiary: 0px !important;
      }
       
      sn-search-results-container, sn-search-combobox {
        --now-color_alert--warning-1: rgb(40,103,178) !important;
      }
      Application Application this style sheet applies to. Global means the style sheet applies to all applications.
    3. Select Submit.
  2. Create a CSS include record.
    1. Enter sp_css_include.do in the filter navigator.
    2. On the form, fill in the fields.
  3. Input your CSS override into the style sheets form and override the theme that's applied to your UI.
    1. Enter m2m_sp_theme_css_include in the filter navigator.
    2. On the form, fill in the fields.
    3. Select Submit.

Result

The borders around the search results container and search filters are removed and the hit highlight color displays your custom color.
Theming for AI Search in SP override results.