Merge branch 'nazar-pc-fix-for-bem-modifiers'

This commit is contained in:
Daniel Freedman 2015-11-04 14:46:27 -08:00
commit bb8429d584
3 changed files with 18 additions and 2 deletions

View File

@ -137,7 +137,7 @@ Polymer.CssParse = (function() {
},
_hasMixinRules: function(rules) {
return (rules[0].selector.indexOf(this.VAR_START) >= 0);
return rules[0].selector.indexOf(this.VAR_START) === 0;
},
removeCustomProps: function(cssText) {

View File

@ -166,7 +166,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
p || '';
}
}
return parts.join(';');
return parts.filter(function(v) {return v;}).join(';');
},
applyProperties: function(rule, props) {

View File

@ -117,6 +117,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
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>
@ -143,6 +155,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<div class="foo"></div>
<div class="foo--bar style-scope"></div>
<dom-module id="x-baz">
<style>
@ -461,6 +474,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
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');
});
});