sub-topic Less Starterkit
Below are instructions on how to create a Bootstrap sub-theme using a Less preprocessor.
- Read the Getting Started and Sub-theming documentation topics.
- You must understand the basic concept of using the Less CSS pre-processor.
- You must use a local Less compiler.
- You must use the Bootstrap Framework Source Files ending in the
.lessextension, not files ending in
Download and extract the latest 3.x.x version of
Bootstrap Framework Source Files into your new sub-theme. After it has been
extracted, the folder should read
If for whatever reason you have an additional
bootstrap folder wrapping the
bootstrap folder (e.g.
./subtheme/bootstrap/bootstrap), remove the
bootstrap folder. You will only ever need to touch these files if
or when you upgrade your version of the Bootstrap Framework.
WARNING: Do not modify the files inside of
./subtheme/bootstrap directly. Doing so may cause issues when upgrading the
Bootstrap Framework in the future.
./subtheme/less/variable-overrides.less file is generally where you will
the majority of your time overriding the variables provided by the Bootstrap
./subtheme/less/bootstrap.less file is nearly an exact copy from the
Bootstrap Framework Source Files. The only difference is that it injects the
variable-overrides.less file directly after it has imported the Bootstrap
variables.less file. This allows you to easily override variables
without having to constantly keep up with newer or missing variables during an
./subtheme/less/overrides.less file contains various Drupal overrides to
properly integrate with the Bootstrap Framework. It may contain a few
enhancements, feel free to edit this file as you see fit.
./subtheme/less/style.less file is the glue that combines the
overrides.less files together. Generally, you will not
need to modify this file unless you need to add or remove files to be imported.
This is the file that you should compile to
the same file name, using a different extension of course).