Skip to content

Commit

Permalink
Merge branch 'fix-for-bem-modifiers' of https://github.com/nazar-pc/p…
Browse files Browse the repository at this point in the history
…olymer into nazar-pc-fix-for-bem-modifiers
  • Loading branch information
dfreedm committed Nov 4, 2015
2 parents 3378b4f + 35c89f1 commit 7d905d5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/css-parse.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
},

_hasMixinRules: function(rules) {
return (rules[0].selector.indexOf(this.VAR_START) >= 0);
return rules[0].selector.indexOf(this.VAR_START) === 0;
},

removeCustomProps: function(cssText) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/style-properties.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
p || '';
}
}
return parts.join(';');
return parts.filter(function(v) {return v;}).join(';');
},

applyProperties: function(rule, props) {
Expand Down
16 changes: 16 additions & 0 deletions test/unit/custom-style.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@
border: 20px solid blue;
}
</style>
<style>
.foo--bar {
border-top : 3px solid red;
}
</style>
<style is="custom-style">
@media (min-width: 1px) {
.foo--bar {
border-top : 20px solid blue;
}
}
</style>
</head>
<body>
<div class="italic">italic</div>
Expand All @@ -143,6 +155,7 @@

<div class="foo"></div>

<div class="foo--bar style-scope"></div>

<dom-module id="x-baz">
<style>
Expand Down Expand Up @@ -461,6 +474,9 @@
var computed = getComputedStyle(el);
assert.equal(computed['font-family'].replace(/['"]+/g, ''), 'Varela font');
});
test('BEM-like CSS selectors under media queries', function() {
assertComputed(document.querySelector('.foo--bar'), '3px');
});

});

Expand Down

0 comments on commit 7d905d5

Please sign in to comment.