postcss-only-directive
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -17,2 +17,5 @@ // @format | ||
}); | ||
it('keeps @only declarations', function () { | ||
return run('@onlyRender(:root); a { border: 1; @only(small) { border: 0; } }', 'a { border: 1 }', {}); | ||
}); | ||
it('keeps other rules', function () { | ||
@@ -32,2 +35,5 @@ return run('@onlyRender(:root); @only(small) { a { } } b { color: blue; }', 'b { color: blue; }', {}); | ||
}); | ||
it('keeps @only declarations', function () { | ||
return run('@onlyRender(small); a { border: 1; @only(small) { border: 0; } }', 'a { border: 0 }', {}); | ||
}); | ||
it('keeps nested @ rules', function () { | ||
@@ -34,0 +40,0 @@ return run('@onlyRender(small); @only(small) { @media(print) { a { } } }', ' @media(print) { a { } }', {}); |
{ | ||
"name": "postcss-only-directive", | ||
"description": "PostCSS plugin Allows you to easily create entrypoint files which contain only certain rules.", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "files": [ |
@@ -19,3 +19,6 @@ # PostCSS Only Directive [![Build Status][ci-img]][ci] | ||
.button { background: blue; } | ||
.button { | ||
background: blue; | ||
@only(ie) { content: 'ie only'; } | ||
} | ||
@@ -40,11 +43,9 @@ @only(medium) { | ||
```css | ||
/* medium.scss */ | ||
@onlyRender(medium); | ||
/* ie.scss */ | ||
@onlyRender(ie); | ||
@import 'component'; // inlines the css | ||
``` | ||
```css | ||
/* medium.css */ | ||
@media(min-width: 500px) { | ||
.button { background: green; } | ||
} | ||
/* ie.css */ | ||
.button { content: 'ie only'; } | ||
``` | ||
@@ -63,2 +64,3 @@ | ||
} | ||
@media(min-width: 900px) { | ||
@@ -88,6 +90,11 @@ .button { background: red; } | ||
/* app.css */ | ||
.button { background: blue; } | ||
.button { | ||
background: blue; | ||
content: 'ie only'; | ||
} | ||
@media(min-width: 500px) { | ||
.button { background: green; } | ||
} | ||
@media(min-width: 900px) { | ||
@@ -94,0 +101,0 @@ .button { background: red; } |
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
14881
289
157