Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-only-directive

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-only-directive - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

6

dist-src/index.test.js

@@ -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 { } }', {});

2

package.json
{
"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; }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc