Skip to content

Commit

Permalink
Allow arbitrary whitespace in CSS imports
Browse files Browse the repository at this point in the history
  • Loading branch information
TimvdLippe committed Aug 8, 2017
1 parent a7978e9 commit 5c250d4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/utils/style-gather.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* @this {StyleGather}
*/
cssFromModules(moduleIds) {
let modules = moduleIds.trim().split(' ');
let modules = moduleIds.trim().split(/\s+/);
let cssText = '';
for (let i=0; i < modules.length; i++) {
cssText += this.cssFromModule(modules[i]);
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 @@ -30,7 +30,8 @@
<link rel="import" href="sub/style-import.html">

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

--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 @@ -393,6 +393,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('imperative custom style', function() {
var cs = document.createElement('custom-style');
var style = document.createElement('style');
Expand Down
10 changes: 10 additions & 0 deletions 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 id="style-import2">
<template>
<style>
.foo {
width: 4px;
}
</style>
</template>
</dom-module>

0 comments on commit 5c250d4

Please sign in to comment.