1.0.6 • Published 8 months ago

css-namespace v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

CSS Namespace

This utility takes a css file (input) and prefixes (namespaces) the css rules with a predefined selector.

Why

I needed to add a selector to every single rule in a large CSS file post build. I couldn't find anything that did what I needed, so I built it!

Running

You can run this by either installing this package as a dev dependency or by using npx.

Install as a dev dependency

npm install --save-dev css-namespace

You can then add a script to your package.json file to run the utility.

{
    "scripts": {
        "build-css": "css-namespace -i ./src/styles.css -s #app -w"
    }
}

Using npx

npx css-container -i ./src/styles.css -s #app -w

Command Line Args

ArgumentAliasTypeDefault ValueDescription
verbosevBooleanfalseEnable verbose mode for detailed output.
inputiStringSpecify the input file or data source.
selectorsStringDefine a selector for filtering data.
outputoString'./output.css'Specify the output file or destination.
overwritewBooleanfalseOverwrite the original css file (output is ignored)
prettyBooleanfalseEnable pretty formatting for the output data.
1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago