How to change the color of the table of contents?

Prev Next

Plans supporting the use of custom CSS and JS in knowledge base site

Professional
Business
Enterprise






You would want to change the color of the table of contents to showcase it better. Follow the below steps to change the color of the table of contents.

Solution

  1. Navigate to Settings () > Knowledge base site > Customize site > Custom CSS & JavaScript in the Knowledge base portal.

  2. Paste the below code snippet in the Custom CSS tab.

.content_block .content_container .page-action .article_action_links ul li a
{
color: red !important;
}
  1. In the above snippet, you can replace the color red with any other color of your choice.

  2. Click Save.

  1. Navigate to Settings () > Knowledge base site > Customize site > Custom CSS & JavaScript in the Knowledge base portal.

  2. Paste the below code snippet in the Custom CSS tab to change the color of the table of contents.

d360-table-of-content .toc-item .toc-toggle-icon,
d360-table-of-content .toc-item a {
    color: red !important;
}
  1. Paste the below code snippet in the Custom CSS tab to change the color of the selected heading in the table of contents.

d360-table-of-content .toc-item.selected a {
    color: blue !important;
}
  1. In the above snippets, you can replace the colors with any other color of your choice.

  2. Click Save.


Outcome

Before

The default color of the table of contents is grey and the content actively open will be highlighted in blue color.

2_Screenshot_Before_color_of_table_of_Content.png

After

After updating the code snippet in Custom CSS, the color of the table of contents other than the actively open content will be changed to red.

3_Screenshot_After_color_of_table_of_Content.png