If you need to extend or override the styling of the administration interface (for example when developing a custom module), add your custom styles into the custom.less file in the App_Themes\Default\Bootstrap folder of your Kentico web project.
Note: The custom.less file is explicitly intended for customization, and is never modified by Kentico upgrades or hotfixes.
Compiling the LESS code
Modifying LESS files does not have an immediate effect on the styles in the administration interface. You also need to compile the LESS code into CSS files, which are then linked into the administration interface pages.
For example, you can use Visual Studio 2015 and the Grunt task runner to set up automatic LESS compilation:
- Download the and package.json files.
- Copy both files into the CMS folder of your Kentico web project.
- Open your Kentico solution in Visual Studio.
On web site projects, Visual Studio automatically installs the required packages.
For web application projects, you need to perform the following additional steps:
- Include the new files in the CMSApp project:
- Click Show all files at the top of the Solution Explorer.
- Select the Gruntfile.js and package.json files.
- Right-click one of the files and select Include in Project.
- Right-click package.json and select Restore Packages.
- Wait until the required packages are installed.
- Save the CMSApp project.
- Close and then reopen the solution.
You can now see a watch task in the Visual Studio Task Runner Explorer. When you modify the custom.less file, the styles are automatically compiled into the CSS that is applied to the administration interface.
Was this page helpful?