1 |
4eeb3b46
|
Assos Assos
|
<!-- @file Instructions for subtheming using the Less Starterkit. -->
|
2 |
caf16a48
|
Assos Assos
|
<!-- @defgroup subtheme_less -->
|
3 |
|
|
<!-- @ingroup subtheme -->
|
4 |
4eeb3b46
|
Assos Assos
|
# Less Starterkit
|
5 |
caf16a48
|
Assos Assos
|
|
6 |
4eeb3b46
|
Assos Assos
|
Below are instructions on how to create a Bootstrap sub-theme using a Less
|
7 |
caf16a48
|
Assos Assos
|
preprocessor.
|
8 |
|
|
|
9 |
|
|
- [Prerequisites](#prerequisites)
|
10 |
|
|
- [Additional Setup](#setup)
|
11 |
4eeb3b46
|
Assos Assos
|
- [Overrides](#overrides)
|
12 |
caf16a48
|
Assos Assos
|
|
13 |
|
|
## Prerequisites
|
14 |
1f623f01
|
Assos Assos
|
- Read the @link getting_started Getting Started @endlink and @link subtheme Sub-theming @endlink documentation topics.
|
15 |
4eeb3b46
|
Assos Assos
|
- You must understand the basic concept of using the [Less] CSS pre-processor.
|
16 |
|
|
- You must use a **[local Less compiler](https://www.google.com/search?q=less+compiler)**.
|
17 |
caf16a48
|
Assos Assos
|
- You must use the [Bootstrap Framework Source Files] ending in the `.less`
|
18 |
|
|
extension, not files ending in `.css`.
|
19 |
|
|
|
20 |
|
|
## Additional Setup {#setup}
|
21 |
b220caf9
|
Assos Assos
|
Download and extract the **latest** 3.x.x version of
|
22 |
|
|
[Bootstrap Framework Source Files] into your new sub-theme. After it has been
|
23 |
|
|
extracted, the folder should read `./subtheme/bootstrap`.
|
24 |
caf16a48
|
Assos Assos
|
|
25 |
|
|
If for whatever reason you have an additional `bootstrap` folder wrapping the
|
26 |
|
|
first `bootstrap` folder (e.g. `./subtheme/bootstrap/bootstrap`), remove the
|
27 |
|
|
wrapping `bootstrap` folder. You will only ever need to touch these files if
|
28 |
|
|
or when you upgrade your version of the [Bootstrap Framework].
|
29 |
|
|
|
30 |
|
|
{.alert.alert-warning} **WARNING:** Do not modify the files inside of
|
31 |
|
|
`./subtheme/bootstrap` directly. Doing so may cause issues when upgrading the
|
32 |
|
|
[Bootstrap Framework] in the future.
|
33 |
|
|
|
34 |
4eeb3b46
|
Assos Assos
|
## Overrides {#overrides}
|
35 |
caf16a48
|
Assos Assos
|
The `./subtheme/less/variable-overrides.less` file is generally where you will
|
36 |
|
|
the majority of your time overriding the variables provided by the [Bootstrap
|
37 |
|
|
Framework].
|
38 |
|
|
|
39 |
|
|
The `./subtheme/less/bootstrap.less` file is nearly an exact copy from the
|
40 |
|
|
[Bootstrap Framework Source Files]. The only difference is that it injects the
|
41 |
4eeb3b46
|
Assos Assos
|
`variable-overrides.less` file directly after it has imported the [Bootstrap
|
42 |
caf16a48
|
Assos Assos
|
Framework]'s `variables.less` file. This allows you to easily override variables
|
43 |
|
|
without having to constantly keep up with newer or missing variables during an
|
44 |
|
|
upgrade.
|
45 |
|
|
|
46 |
|
|
The `./subtheme/less/overrides.less` file contains various Drupal overrides to
|
47 |
|
|
properly integrate with the [Bootstrap Framework]. It may contain a few
|
48 |
|
|
enhancements, feel free to edit this file as you see fit.
|
49 |
|
|
|
50 |
|
|
The `./subtheme/less/style.less` file is the glue that combines the
|
51 |
|
|
`bootstrap.less` and `overrides.less` files together. Generally, you will not
|
52 |
|
|
need to modify this file unless you need to add or remove files to be imported.
|
53 |
|
|
This is the file that you should compile to `./subtheme/css/styles.css` (note
|
54 |
|
|
the same file name, using a different extension of course).
|
55 |
|
|
|
56 |
4eeb3b46
|
Assos Assos
|
#### See also:
|
57 |
|
|
- @link templates Templates @endlink
|
58 |
|
|
- @link theme_settings Theme Settings @endlink
|
59 |
|
|
- @link registry Theme Registry @endlink
|
60 |
caf16a48
|
Assos Assos
|
|
61 |
|
|
[Bootstrap Framework]: http://getbootstrap.com
|
62 |
|
|
[Bootstrap Framework Source Files]: https://github.com/twbs/bootstrap/releases
|
63 |
4eeb3b46
|
Assos Assos
|
[Less]: http://lesscss.org |