Skip to content

Commit 9b00efa

Browse files
authored
Merge pull request #4780 from Polymer/whitespace-css-imports
Allow arbitrary whitespace in CSS imports
2 parents bbf0e7c + 5c250d4 commit 9b00efa

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

lib/utils/style-gather.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
* @this {StyleGather}
4747
*/
4848
cssFromModules(moduleIds) {
49-
let modules = moduleIds.trim().split(' ');
49+
let modules = moduleIds.trim().split(/\s+/);
5050
let cssText = '';
5151
for (let i=0; i < modules.length; i++) {
5252
cssText += this.cssFromModule(modules[i]);

test/unit/custom-style-import.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
<link rel="import" href="sub/style-import.html">
3131

3232
<custom-style>
33-
<style is="custom-style" include="shared-style style-import">
33+
<style is="custom-style" include="shared-style style-import
34+
style-import2">
3435
html {
3536

3637
--import-mixin: {

test/unit/custom-style.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,11 @@
393393
assert.include(url, 'sub/google.png');
394394
});
395395

396+
test('style paths can have arbitrary whitespace', function() {
397+
var foo = document.querySelector('.foo');
398+
assertComputed(foo, '4px', 'width');
399+
});
400+
396401
test('imperative custom style', function() {
397402
var cs = document.createElement('custom-style');
398403
var style = document.createElement('style');

test/unit/sub/style-import.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,14 @@
88
}
99
</style>
1010
</template>
11+
</dom-module>
12+
13+
<dom-module id="style-import2">
14+
<template>
15+
<style>
16+
.foo {
17+
width: 4px;
18+
}
19+
</style>
20+
</template>
1121
</dom-module>

0 commit comments

Comments
 (0)