CSS Less(ish)
Use variables and nesting in your css files with Sublime Text 2 & 3
Details
Installs
- Total 169K
- Win 159K
- Mac 7K
- Linux 3K
Feb 22 | Feb 21 | Feb 20 | Feb 19 | Feb 18 | Feb 17 | Feb 16 | Feb 15 | Feb 14 | Feb 13 | Feb 12 | Feb 11 | Feb 10 | Feb 9 | Feb 8 | Feb 7 | Feb 6 | Feb 5 | Feb 4 | Feb 3 | Feb 2 | Feb 1 | Jan 31 | Jan 30 | Jan 29 | Jan 28 | Jan 27 | Jan 26 | Jan 25 | Jan 24 | Jan 23 | Jan 22 | Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 2 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
CSS Less(ish)
A Sublime Text 2 & 3 plugin that implements a stripped down version of the functionality in css preprocessors (such as LESS) so that you can use css variables and nesting without any effort.
CSS Variables
Store variables within comments using the “@” symbol, then use them anywhere within your css.
produces
a { color: #6699CC; }
CSS Nesting
Nest styles within other blocks to append that selector to all children.
header [
h1 { color:blue }
a { color:blue }
]
produces
header h1 { color:blue }
header a { color:blue }
CSS Colours
Use colour functions when declaring css variables including lighten
, darken
, saturate
, and desaturate
. You can pass existing variables as arguments too.
produces
a { color: #3d7ab7; }
CSS Functions
Several css shortcuts functions are available including transition
, transform
, box-shadow
, and linear-gradient
. (These reference http://caniuse.com for browser specific rules)
/*
@transition = transition(all 0.3s ease)
@transform = transform(rotate(0.6deg))
@shadow = box-shadow(0 0 0.4em #000)
@gradient = linear-gradient(#fff, #ddd)
*/
div {
@transition;
@transform;
@shadow;
@gradient;
}
produces
div {
-webkit-transition: all 0.3s ease;
transition: all 0.3s ease;
-webkit-transform: rotate(0.6deg);
-ms-transform: rotate(0.6deg);
transform: rotate(0.6deg);
-webkit-box-shadow: 0 0 0.4em #000;
box-shadow: 0 0 0.4em #000;
background-image: -webkit-linear-gradient(bottom, #fff, #ddd);
background-image: linear-gradient(to top, #fff, #ddd);
}
CSS Maths
You can add and multiply numeric variables too (works with px, em or %)
produces
div { width: 12em; }
How does it work?
The plugin doesn't require any third party libraries or tools to be installed - in fact it's not really a css preprocessor at all.
When you save a css file using the features above the plugin instantly compiles down the output “pre save”, writes it to disk, then restores your original css (all without you seeing it).
Why?
CSS proprocessors are wonderfully powerful, but I wanted to be able to use the essential functionality they provide simply and without any effort. The other advantage is that when debugging, your css styles are traced back to the original source document (since your css smarts comes from the file itself rather than being compiled into a separate file)
Read More
You can read more on the wiki.