Comparing version 2.0.0 to 2.0.1
@@ -11,3 +11,6 @@ # Change Log | ||
<!-- New PRs should document their changes here. --> | ||
## [2.0.1] - 2017-09-29 | ||
* Make sure `@apply` always has a semicolon at the end | ||
## [2.0.0] - 2017-09-11 | ||
@@ -14,0 +17,0 @@ |
@@ -51,3 +51,10 @@ /** | ||
const APPLY_NO_SEMI = /@apply \(?--[\w-]+\)?[^;]/g; | ||
function addSemi(match) { | ||
return match + ';'; | ||
} | ||
function css(text) { | ||
text = text.replace(APPLY_NO_SEMI, addSemi); | ||
return stringifier.stringify(parser.parse(text)); | ||
@@ -54,0 +61,0 @@ } |
{ | ||
"name": "css-slam", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Minimal CSS, fast", | ||
@@ -20,3 +20,3 @@ "main": "index.js", | ||
"chai": "^4.1.2", | ||
"eslint": "^4.6.1", | ||
"eslint": "^4.7.2", | ||
"mocha": "^3.5.3", | ||
@@ -23,0 +23,0 @@ "vinyl": "^2.1.0" |
11
test.js
@@ -76,2 +76,13 @@ /** | ||
}); | ||
test('@apply missing semicolon is fixed', () => { | ||
const text = | ||
`:host { | ||
@apply --foo | ||
} | ||
:root { | ||
@apply(--bar) | ||
}`; | ||
const expected = `:host{@apply --foo;}:root{@apply (--bar);}`; | ||
assert.equal(slam.css(text), expected); | ||
}) | ||
}); | ||
@@ -78,0 +89,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16205
272