https://github.com/tiaanduplessis/css-inject
Inject CSS rules into the head above any other stylesheets
https://github.com/tiaanduplessis/css-inject
css head inject style stylesheet
Last synced: 11 months ago
JSON representation
Inject CSS rules into the head above any other stylesheets
- Host: GitHub
- URL: https://github.com/tiaanduplessis/css-inject
- Owner: tiaanduplessis
- License: mit
- Created: 2017-11-09T07:48:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-02T22:56:48.000Z (about 7 years ago)
- Last Synced: 2025-07-08T11:55:53.309Z (12 months ago)
- Topics: css, head, inject, style, stylesheet
- Language: JavaScript
- Size: 681 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# css-inject
[](https://npmjs.org/package/css-inject)
[](https://npmjs.org/package/css-inject)
[](https://github.com/RichardLitt/standard-readme)
[](https://npmjs.org/package/css-inject)
[](http://makeapullrequest.com) [](https://greenkeeper.io/)
> Inject CSS rules into the head above any other stylesheets
## Table of Contents
- [Install](#install)
- [Usage](#usage)
- [Contribute](#contribute)
- [License](#License)
## Install
This project uses [node](https://nodejs.org) and [npm](https://www.npmjs.com).
```sh
$ npm install css-inject
$ # OR
$ yarn add css-inject
```
## Usage
```js
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