Projet

Général

Profil

Paste
Télécharger (3 ko) Statistiques
| Branche: | Révision:

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

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** 3.x.x version of
24
[Bootstrap Framework Source Files] into your new sub-theme. After it has been
25
extracted, the folder should read `./subtheme/bootstrap`.
26

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

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

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

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

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

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

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

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

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