Many times you'll want to customize specific elements like an article details page, add ticket form, topic lists, or anything else visible on the help center theme. You might also want to edit it globally (on the entire help center) or only for specific categories. In these cases, you'll need to use Cascading Style Sheets (CSS) to customize the style of your theme.
But if you're new to this whole CSS thing, you need to understand a couple of things. Elements of your help center are given classes and id's. You set styles for specific classes and id's in your help center theme's CSS section. The most powerful tool at your disposal for this task is your browser inspector, which will show you all the CSS associated with any part of your help center page. The inspector will help you identify the selector or original style containing the properties you want to change. You can then copy these selectors over to your CSS customization box, to add your custom properties.
In this guide, we'll share the properties that you can customize and also demonstrate a CSS customization that you can accomplish on the help center.
As you can see in the screenshot above, our help center page code starts with the line:
<portal data-reactroot class="html articleSubCategory signedIn zohodesk">
This is the root element of the React component where you can customize the appearance and behavior of your help center in a clear and secure way. It consists of three different class attributes and let's look at each one of them below:
- articleSubCategory: This attribute defines the pages on which customization should be applied, so that the style won't apply anywhere else. The following table lists the other attributes that shall be referred to while performing customizations.
Page
| Class Name
|
Home
| home
|
Ticket List
| ticketList
|
Ticket Detail
| ticketDetail
|
Add Ticket
| ticketForm
|
KB Category List
| kbLanding
|
KB Subcategory
| article_subcategory
|
Article List
| articleList
|
Article Detail
| articleDetail
|
Community Category
| communityLanding
|
Topic List
| communityList
|
Topic Detail
| communityDetail
|
Add Topic
| topicForm
|
User Profile
| userProfile
|
Sign in
| signin
|
Signed-in
| signedIn
|
Sign up
| signup
|
Forgot Password
| forgetPwd
|
- signedIn: This attribute defines the authentication status of a user. When specified, the customization is shown for users signed in to your help center. You can remove this attribute while making global changes.
- zohodesk: This attribute refers to the name of the category. When specified, the customization is shown for users accessing the specific knowledge base category.
Sample CSS Customization
Let's look at a sample CSS customization script that removes the background image on the header and adds a background color to the "KB Subcategory" page.
Before Customization
After Customization
You can use the following CSS code to customize the page as above:
.articleSubCategory .Header__header{
background-image: none;
background-color: red
}