Projet

Général

Profil

Paste
Télécharger (2,98 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / bootstrap / starterkits / less / README.md @ 749b8a23

1
<!-- @file Instructions for subtheming using the LESS Starterkit. -->
2
<!-- @defgroup subtheme_less -->
3
<!-- @ingroup subtheme -->
4
# LESS Starterkit
5

    
6
Below are instructions on how to create a Bootstrap sub-theme using a LESS
7
preprocessor.
8

    
9
- [Prerequisites](#prerequisites)
10
- [Additional Setup](#setup)
11
- [Override Styles](#styles)
12
- [Override Settings](#settings)
13
- [Override Templates and Theme Functions](#registry)
14

    
15
## Prerequisites
16
- Read the @link getting_started Getting Started @endlink documentation topic.
17
- You must understand the basic concept of using the [LESS] CSS pre-processor.
18
- You must use a **[local LESS compiler](https://www.google.com/search?q=less+compiler)**.
19
- You must use the [Bootstrap Framework Source Files] ending in the `.less`
20
  extension, not files ending in `.css`.
21

    
22
## Additional Setup {#setup}
23
Download and extract the **latest** [Bootstrap Framework Source Files] into your
24
new sub-theme. After it has been extracted, the folder should read `./subtheme/bootstrap`.
25

    
26
If for whatever reason you have an additional `bootstrap` folder wrapping the
27
first `bootstrap` folder (e.g. `./subtheme/bootstrap/bootstrap`), remove the
28
wrapping `bootstrap` folder. You will only ever need to touch these files if
29
or when you upgrade your version of the [Bootstrap Framework].
30

    
31
{.alert.alert-warning} **WARNING:** Do not modify the files inside of
32
`./subtheme/bootstrap` directly. Doing so may cause issues when upgrading the
33
[Bootstrap Framework] in the future.
34

    
35
## Override Styles {#styles}
36
The `./subtheme/less/variable-overrides.less` file is generally where you will
37
the majority of your time overriding the variables provided by the [Bootstrap
38
Framework].
39

    
40
The `./subtheme/less/bootstrap.less` file is nearly an exact copy from the
41
[Bootstrap Framework Source Files]. The only difference is that it injects the
42
`variable-overrides.less` file directly after it has imported the[Bootstrap
43
Framework]'s `variables.less` file. This allows you to easily override variables
44
without having to constantly keep up with newer or missing variables during an
45
upgrade.
46

    
47
The `./subtheme/less/overrides.less` file contains various Drupal overrides to
48
properly integrate with the [Bootstrap Framework]. It may contain a few
49
enhancements, feel free to edit this file as you see fit.
50

    
51
The `./subtheme/less/style.less` file is the glue that combines the
52
`bootstrap.less` and `overrides.less` files together. Generally, you will not
53
need to modify this file unless you need to add or remove files to be imported.
54
This is the file that you should compile to `./subtheme/css/styles.css` (note
55
the same file name, using a different extension of course).
56

    
57
## Override Theme Settings {#settings}
58
Please refer to the @link subtheme_settings Sub-theme Settings @endlink topic.
59

    
60
## Override Templates and Theme Functions {#registry}
61
Please refer to the @link registry Theme Registry @endlink topic.
62

    
63
[Bootstrap Framework]: http://getbootstrap.com
64
[Bootstrap Framework Source Files]: https://github.com/twbs/bootstrap/releases
65
[LESS]: http://lesscss.org