Customize Fermion Theme with Custom CSS
You may want to change certain aspects of your website’s appearance with a custom CSS (Cascading Style Sheet) file. In this document we will show you how to add a custom CSS to your VCP MVC / Razor Pages solution to replace the existing Fermion Theme CSS. By adding your custom CSS, you will modify your website’s overall look.
Be aware that custom CSS must contain all the styles that Fermion Theme uses. If you just want to overwrite some styles, you can use
global-styles.css
in thewwwroot
folder of your web project.
How to Add a Custom CSS?
Download Fermion Theme Source-Code
Download the Fermion Theme source-code to retrieve the existing CSS files. To do this create a new folder named as FermionTheme
and run the following VCP CLI command inside the FermionTheme
folder:
vcp get-source Verto.FermionTheme
Copy to Your Project
In the following folder, you will find all the Fermion CSS files.
src\Verto.Vcp.AspNetCore.Mvc.UI.Theme.Fermion\Themes\Fermion\Global\styles
The default theme uses Fermion6.css
.
Create a folder named styles
under the wwwroot
folder of your web project.
Copy Fermion6.css
to the wwwroot/styles
folder and rename it to custom.css
.
Customize the CSS
Open custom.css
and find the .lp-opened-sidebar
style.
Comment out the existing background style and add the following background style which changes the main menu's background color.
background: linear-gradient(7deg, #9f3049, #84a21f);
Set the Style Path
Add the following code to the ConfigureServices
in the YourProjectWebModule.cs
.
Configure<FermionThemeOptions>(options =>
{
options.StylePath = "/styles/custom.css";
});
Run the Web Project
The main menu's background color changed. With this approach, you can change your website’s overall look.