cssnano-ignore-add
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -10,6 +10,6 @@ "use strict"; | ||
var _default = (0, _postcss.plugin)('cssnano-ignore-add', (options = {}) => { | ||
var _default = (0, _postcss.plugin)('cssnano-ignore-add', () => { | ||
return (root, result) => { | ||
const msgs = result.messages; | ||
var declToAdd = []; | ||
let declToAdd = []; | ||
msgs.forEach(msg => { | ||
@@ -16,0 +16,0 @@ if (msg['cssnano-ignore-plugin'] !== undefined) { |
{ | ||
"name": "cssnano-ignore-add", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Ignore CSSNANO operations in lines using comments", | ||
@@ -20,2 +20,3 @@ "main": "dist/index.js", | ||
], | ||
"repository": "anikethsaha/cssnano-ignore-plugin", | ||
"author": { | ||
@@ -29,3 +30,3 @@ "name": "anikethsaha", | ||
}, | ||
"gitHead": "a54b0bc4cfa53bc4de05c56b0080c6161bc80932" | ||
"gitHead": "a913f3d09a43d07598902f9f3cd8c3f99b668469" | ||
} |
@@ -1,5 +0,12 @@ | ||
# cssnano-ignore-add | ||
# cssnano-ignore-plugin | ||
![CI tests](https://github.com/anikethsaha/cssnano-ignore-plugin/workflows/CI%20tests/badge.svg?branch=master&event=push) | ||
![CI Integration tests](https://github.com/anikethsaha/cssnano-ignore-plugin/workflows/CI%20Integration%20tests/badge.svg?branch=master&event=push) | ||
Ignore CSSNANO operations in lines using comments | ||
> ### These packages will be moved to [`CSSNANO`](https://github.com/cssnano/cssnano) soon once its ready to use | ||
# Status | ||
> ### WORK IN PROGRESS :warning: | ||
@@ -9,8 +16,7 @@ | ||
This will be soon ship with `cssnano default preset`. | ||
In the meantime, install it using | ||
This will be soon ship with `cssnano default preset`. | ||
In the meantime, install it using | ||
`$ yarn add cssnano-ignore-add cssnano-ignore-remove -D` | ||
` $ yarn add cssnano-ignore-add cssnano-ignore-remove -D` | ||
and add this it in your `postcss` config | ||
@@ -22,10 +28,10 @@ | ||
plugins: [ | ||
require("cssnano-ignore-remove"), | ||
require("cssnano"), | ||
require("cssnano-ignore-add") | ||
] | ||
require('cssnano-ignore-remove'), | ||
require('cssnano'), | ||
require('cssnano-ignore-add'), | ||
], | ||
}; | ||
``` | ||
> This can be just with any of `postcss` plugin, not just with cssnano. But the comment will be same | ||
> This can be just with any of `postcss` plugin, not just with cssnano. But the comment will be same | ||
> | ||
@@ -36,5 +42,4 @@ > ```css | ||
# How it works | ||
# How it works | ||
In order to stop cssnano doing optimization on some particular line, you simply need to add `/* cssnano-ignore-line */` comment over that line. | ||
@@ -46,9 +51,8 @@ Currently we support only for declaration statement, that mean you can add this comment over CSS declaration line not over the selector list in Rule declaration | ||
```css | ||
// Correct example | ||
.classname{ | ||
margin : auto; | ||
.classname { | ||
margin: auto; | ||
/* cssnano-ignore-line */ | ||
color : red | ||
color: red; | ||
} | ||
@@ -59,5 +63,5 @@ | ||
/* cssnano-ignore-line */ | ||
.classname{ | ||
margin : auto; | ||
color : red | ||
.classname { | ||
margin: auto; | ||
color: red; | ||
} | ||
@@ -68,11 +72,11 @@ | ||
ul { | ||
list-style : none; | ||
} | ||
list-style: none; | ||
} | ||
} | ||
``` | ||
``` | ||
It simple remove the next line before running the cssnano plugins and then add them at the end. | ||
# Packages | ||
It contains two packages, one to remove the line and another to add it . | ||
@@ -82,2 +86,1 @@ | ||
- [`cssnano-ignore-add`](#cssnano-ignore-add) | ||
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
3956
80