Socket
Socket
Sign inDemoInstall

replace-important

Package Overview
Dependencies
4
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

replace-important

Package for removing !important from css rules from selectors and replacing them inside similar selectors - the new selectors will have the highest specificity in the CSS file.


Version published
Maintainers
1
Weekly downloads
18
increased by50%

Weekly downloads

Readme

Source

replace-important

Replace-important CLI Usage Gif

Package for removing !important from css rules from selectors and replacing them inside similar selectors - the new selectors will have the highest specificity in the CSS file. This is useful for making CSS Supported by AMPHTML. This can be used as a CLI or in your Node projects. We also have a Gulp Plugin as well.

Installation

Globally as CLI

npm install -g replace-important

As a dev dependency to your project

npm install --save-dev replace-important

Usage

CLI

$ replace-important

    Usage:
      replace-important file.css [OPTIONS]

      Options:
        -h, --help          Print usage information
        -o, --output        Specify output file (Default: output.css)

As a Node Module

Try the Runkit from the NPM Page

const replaceImportant = require('replace-important');

const output = replaceImportant('body {background-color: red !important;}');

console.log(output); // body {}:root:not(#FK_ID) body{background-color: red }

Tests

There are golden tests, and CLI tests, that are run with:

npm run test

Contributing

Please see the CONTRIBUTING.md

License

Apache License 2.0

Keywords

FAQs

Last updated on 11 Aug 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc