# append-style-css

> insert a string of css into the

Latest version **1.0.1** (published 2020-06-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install append-style-css
pnpm add append-style-css
yarn add append-style-css
bun add append-style-css
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-06-17 |
| First published | 2020-06-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Curry Chou |
| Maintainers | zhouhuan |
| Keywords | css, insert, dom, styles, stylesheet, style, html, head |

## Links

- npm: https://www.npmjs.com/package/append-style-css
- Repository: https://github.com/CurryChou777/appendCss
- Issues: https://github.com/CurryChou777/appendCss/issues
- npm.io page: https://npm.io/package/append-style-css

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-06-17
- 1.0.0 — 2020-06-16

## README

# appendStyleCss

insert a string of css into the `<head>` or custom element

# example

``` js
    var appendStyleCss = require('append-style-css');
    var styleElement = appendStyleCss('body { background:blue; }');
```

# api

``` js
    var appendStyleCss = require('append-style-css');
```

## var styleElement = appendStyleCss(css, opts);

Insert some CSS into the page.

* `opts.container` - Which HTMLElement to use as the base mounting point, defaults to
`document.querySelector('head')`.

* `opts.prepend` - Add the CSS at the top level of the container instead of at the bottom level (default).

Sometimes you may want to put the default CSS in front of you so that it can be easily overridden by user styles

* `opts.id` - Set the attribute of id for container

* `opts.isClear` - Whether to clear the added css string

# development

## example

``` sh
npm run example
```

---
_Source: https://npm.io/package/append-style-css · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
