rootstrap-library
Version:
Rootstrap library mixins for less.js
79 lines (56 loc) • 1.51 kB
Markdown
rootstrap-library
========================
LESS mixins library that includes utilities for creating and organizing styles within your project.
## lessc usage
To install..
```
npm install -g rootstrap-library
```
## Programmatic usage
To add the library to your LESS project directly:
```
```
Screen name and breakpoints list variables will need to be added manually if not using the rootstrap gulp plugin, which generates them automatically. See https://github.com/skyshab/less-plugin-rootstrap/
```
```
To apply styles within a specific screen range within your LESS files:
```
.screen('default') {
.my-selector {
color: white;
}
}
.screen('tablet-and-under') {
.my-selector {
color: red;
}
}
.screen('desktop') {
.my-selector {
color: blue;
}
}
/* output all styles */
.get-screens();
```
The above would output the following CSS:
```
.my-selector {
color: white;
}
.my-selector {
color: red;
}
}
.my-selector {
color: blue;
}
}
```
Note that get-screens() will only generate a single instance of each media query. Further styles added to the same screen will show up there as well. Best practice is to call get-screens() after adding all of your less files.