Skip to content

Commit

Permalink
add placeholder selector support
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Jan 16, 2013
1 parent 2f5e1ac commit 0b3fa2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions examples/extend-nesting.css
@@ -1,18 +1,18 @@

.dark-button {
%dark-button {
background: black;
}

.dark-button:hover {
%dark-button:hover {
background: rgba(0,0,0,.5);
}

.dark-button:hover .icon {
%dark-button:hover .icon {
color: rgba(255,255,255,.5);
}

button,
.actions a {
extend: .dark-button;
extend: %dark-button;
padding: 5px 10px;
}
3 changes: 2 additions & 1 deletion lib/plugins/extend.js
Expand Up @@ -15,8 +15,9 @@ module.exports = function() {
var map = {};
style.rules.forEach(function(rule){
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);
});
visit(rule, map);
});
Expand Down

0 comments on commit 0b3fa2d

Please sign in to comment.