We will use Bootswatch to create our theme. You should already be familiar with Bootswatch because we used a readymade Bootswatch theme to theme our Bootstrap project earlier in this book.
Let us create a new theme. We we will name it Greenhorn
and move the theme-specific styles and variable overrides there by performing the following steps:
less
directory named greenhorn
.bootswatch.less
in the greenhorn
directory and add the following contents to it:// Greenhorn 1.0.0 // Bootswatch // ----------------------------------------------------- // Navbar ===================================================================== // Buttons ==================================================================== // Typography ================================================================= // Tables ===================================================================== // Forms ====================================================================== // Navs ======================================================================= // Indicators ================================================================= // Progress bars ============================================================== // Containers =================================================================
custom-theme.less
to bootswatch.less
:// Indicators ================================================================= .label { border-radius: 0; } ..... // Containers ================================================================= .container .jumbotron { border-radius: 0; }
custom-variables.less
to the greenhorn
directory and rename it to variables.less
.Now that you have created your theme, you can move the rest of the styles from custom-theme.less
to main.less
and remove custom-theme.less
completely.
Congratulations! You have created you first Bootswatch theme! While it may not seem like much, it is a great starting point for your custom theme.
The sky's the limit! Use your imagination and create the most amazing themes. Next, you will learn how to package your theme using Bootswatch and how to share it.
3.137.178.9