Skip to content

Commit

Permalink
Polymer 1: Allow arbitrary whitespace in CSS imports
Browse files Browse the repository at this point in the history
  • Loading branch information
freshp86 committed Oct 24, 2017
1 parent f530289 commit 9356bd0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/style-util.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
},

cssFromModules: function(moduleIds, warnIfNotFound) {
var modules = moduleIds.trim().split(' ');
var modules = moduleIds.trim().split(/\s+/);
var cssText = '';
for (var i=0; i < modules.length; i++) {
cssText += this.cssFromModule(modules[i], warnIfNotFound);
Expand Down
3 changes: 2 additions & 1 deletion test/unit/custom-style-import.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

<link rel="import" href="sub/style-import.html">

<style is="custom-style" include="shared-style style-import">
<style is="custom-style" include="shared-style style-import
style-import2">
:root {

--import-mixin: {
Expand Down
5 changes: 5 additions & 0 deletions test/unit/custom-style.html
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,11 @@
assert.include(url, 'sub/google.png');
});

test('style paths can have arbitrary whitespace', function() {
var foo = document.querySelector('.foo');
assertComputed(foo, '4px', 'width');
});

test('property in /deep/ rule applied via document scope inheritance', function() {
assertComputed(xFoo.$.deep, '6px');
});
Expand Down
12 changes: 11 additions & 1 deletion test/unit/sub/style-import.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@
}
</style>
</template>
</dom-module>
</dom-module>

<dom-module id="style-import2">
<template>
<style>
.foo {
width: 4px;
}
</style>
</template>
</dom-module>

0 comments on commit 9356bd0

Please sign in to comment.