Comparing version 0.11.0 to 0.12.0
{ | ||
"name": "rework", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "CSS manipulations built on CSSOM", | ||
@@ -5,0 +5,0 @@ "keywords": ["css", "manipulation", "preprocess", "transform"], |
0.12.0 / 2013-01-16 | ||
================== | ||
* add placeholder selector support | ||
0.11.0 / 2013-01-16 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -18,4 +18,5 @@ | ||
if (!rule.declarations) return; | ||
rule.selectors.forEach(function(sel){ | ||
rule.selectors.forEach(function(sel, i){ | ||
map[sel] = rule; | ||
if ('%' == sel[0]) rule.selectors.splice(i, 1); | ||
}); | ||
@@ -22,0 +23,0 @@ visit(rule, map); |
{ | ||
"name": "rework", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "CSS manipulations built on CSSOM", | ||
@@ -5,0 +5,0 @@ "keywords": ["css", "manipulation", "preprocess", "transform"], |
@@ -137,2 +137,49 @@ # rework | ||
Optionally selectors may be prefixed with `%` to create sass-style "placeholder" | ||
selectors, which do not become part of the output. For example: | ||
```css | ||
%dark-button { | ||
background: black; | ||
} | ||
%dark-button:hover { | ||
background: rgba(0,0,0,.5); | ||
} | ||
%dark-button:hover .icon { | ||
color: rgba(255,255,255,.5); | ||
} | ||
button, | ||
.actions a { | ||
extend: %dark-button; | ||
padding: 5px 10px; | ||
} | ||
``` | ||
yields: | ||
```css | ||
button, | ||
.actions a { | ||
background: black | ||
} | ||
button:hover, | ||
.actions a:hover { | ||
background: rgba(0,0,0,.5) | ||
} | ||
button:hover .icon, | ||
.actions a:hover .icon { | ||
color: rgba(255,255,255,.5) | ||
} | ||
button, | ||
.actions a { | ||
padding: 5px 10px | ||
} | ||
``` | ||
### .media(obj) | ||
@@ -733,3 +780,3 @@ | ||
} | ||
}); | ||
@@ -747,4 +794,4 @@ }); | ||
## License | ||
## License | ||
MIT |
43188
972
795