Get unlimited public & private packages + team-based management with npm Teams.Learn more »

postcss-uncomment

1.1.0 • Public • Published

PostCSS Uncomment PostCSS Logo

NPM Version Linux Build Status

PostCSS Uncomment lets you turn a comment into a CSS declaration.

// #uncomment @import "skip-sass.css"; 
 
/* becomes */
 
@import "skip-sass.css";
/* #uncomment @import "special-import"; */
 
/* becomes */
 
@import “special-import”;

This plugin was created while working on migrating a project from Sass to Postcss. Challenges arose due to the two types of imports being incompatible. The goal of this plugin is to avoid the situation of having to convert all of your styles in one change.

This plugin allows you to have imports for Sass and CSS files at the same time by hiding the CSS imports, running Node-Sass, un-hiding the CSS imports (by running this plugin) and finally running Postcss plugins (including postcss-import) on the remaining styles.

You could have imports that look like:

@import "sass-file";
// #uncomment @import "css-file.css"; 

and by running: postcss-sass -> postcss-uncomment -> postcss-import -> ...

these files could be properly processed with an expected output.

Install

npm i postcss-uncomment

DownloadsWeekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

6.13 kB

Total Files

5

Last publish

Collaborators

  • avatar