diff --git a/src/generators/shared/css/transform.js b/src/generators/shared/css/transform.js index 803c16d47adf..12ae0981e58f 100644 --- a/src/generators/shared/css/transform.js +++ b/src/generators/shared/css/transform.js @@ -1,6 +1,6 @@ // largely borrowed from Ractive – https://github.com/ractivejs/ractive/blob/2ec648aaf5296bb88c21812e947e0e42fcc456e3/src/Ractive/config/custom/css/transform.js const selectorsPattern = /(?:^|\})?\s*([^\{\}]+)\s*\{/g; -const commentsPattern = /\/\*.*?\*\//g; +const commentsPattern = /\/\*[\s\S]*?\*\//g; const selectorUnitPattern = /((?:(?:\[[^\]+]\])|(?:[^\s\+\>~:]))+)((?:::?[^\s\+\>\~\(:]+(?:\([^\)]+\))?)*\s*[\s\+\>\~]?)\s*/g; const excludePattern = /^(?:@|\d+%)/; diff --git a/test/generator/css-comments/_config.js b/test/generator/css-comments/_config.js new file mode 100644 index 000000000000..f6235d06a20d --- /dev/null +++ b/test/generator/css-comments/_config.js @@ -0,0 +1,7 @@ +// JSDOM makes this test pass when it should fail. weird +export default { + test ( assert, component, target, window ) { + const p = target.querySelector( 'p' ); + assert.equal( window.getComputedStyle( p ).color, 'red' ); + } +}; diff --git a/test/generator/css-comments/main.html b/test/generator/css-comments/main.html new file mode 100644 index 000000000000..68eebfdf38b7 --- /dev/null +++ b/test/generator/css-comments/main.html @@ -0,0 +1,11 @@ +
red
+ +