Skip to content

Inject CSS rules into the head above any other stylesheets

License

Notifications You must be signed in to change notification settings

tiaanduplessis/css-inject

Repository files navigation

css-inject

package version package downloads standard-readme compliant package license make a pull request Greenkeeper badge

Inject CSS rules into the head above any other stylesheets

Table of Contents

Install

This project uses node and npm.

$ npm install css-inject
$ # OR
$ yarn add css-inject

Usage

import ccInject from 'css-inject'

const rules = `
  body { background: tomato; }
  div { padding: 10px; }
`

const remove = cssInject(rules)

// To remove style again
remove()

Contribute

  1. Fork it and create your feature branch: git checkout -b my-new-feature
  2. Commit your changes: git commit -am 'Add some feature'
  3. Push to the branch: git push origin my-new-feature
  4. Submit a pull request

License

MIT

About

Inject CSS rules into the head above any other stylesheets

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published