Guide to cPanel Interface Customization - Troubleshoot Custom Styles

Introduction

Use this document to troubleshoot your custom styles.

Custom CSS does not render


Problem:

The cPanel interface does not render some or all of the custom CSS elements that you added to thestyles.css file.

Solution:

In most cases, this problem occurs because the styles.css file does not exist in the correct location. Make certain that you saved yourstyles.css file in the appropriate location:

  • For all of the accounts on the server — /var/cpanel/customizations/styled/mystyle/

  • For all of the cPanel accounts that a reseller owns — /home/reseller/var/cpanel/reseller/styled/mystyle/

  • For a specific cPanel account — /home/username/var/cpanel/styled/mystyle/

Notes:

  • mystyle represents the name of the style's directory.
  • reseller represents the reseller's username.
  • username represents the cPanel account's username.
  • If the server uses a customized home directory path, make certain that you use the appropriate path for that home directory.
  • If these directories do not currently exist on the server, use the mkdir command to create them.
 

 

If the styles.css file exists in the correct location, perform the following steps to check whether the cPanel interface uses custom CSS files correctly:

  1. Create a new style directory within the appropriate directory.

  2. In your preferred text editor, create a styles.css file in the new directory with the following contents:

    1
    2
    3
    body {
        background-colorblue;
    }
  3. Use your preferred method to apply the style that you just created.

    Note:

    To make certain that you applied the style correctly, we recommend that you apply the style through the cPanel interface. 

  4. Navigate to the cPanel interface in your browser, and perform a hard refresh.
    • On Mac computers, press Command+Shift+R.
    • On Windows computers, press Ctrl+F5.
  5. Check whether the cPanel interface now displays a blue background. If it does, the styles.css file exists in the correct location, and the cPanel interface can read it correctly. 
  6. Check your CSS file for errors. If the problem persists and no errors exist in the file, you may need to submit a ticket with cPanel Technical Support.

Custom icons do not display


Problem:

Your custom style includes custom icons, but the cPanel interface continues to display the default cPanel-provided icons, or icons from another style.

Solution:

In most cases, this problem occurs because you did not run the/usr/local/cpanel/bin/sprite_generator utility after you applied the style. This utility integrates your icons into the cPanel interface's icon set.

To use this utility, run the following command, where mystyle represents the style name:

/usr/local/cpanel/bin/sprite_generator --theme paper_lantern --style mystyle

If this command does not solve the issue, confirm that you stored the icons in the correct location in your style, and that they use the correct filenames.

  • You must save icon files in the icons subdirectory within the main style directory. For example, if you created the mystyle style and applied it to all of the accounts on the server, icon files should exist in the/var/cpanel/customizations/styled/mystyle/icons/ directory.
  • To replace existing cPanel feature icons, you must use the same names and file extensions as the icons that you wish to replace. 
    • For example, to replace the File Manager feature's icon, you must save the icon as the file_manager.png file.

Make certain that you clear your browser's cache regularly while you troubleshoot this issue. If your browser caches the cPanel interface, you may not see the results of your changes immediately.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....