# inject-static-sheet

> Wrapper for react-jss injectSheet providing deterministic className prefixing

Latest version **2.0.1** (published 2018-03-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install inject-static-sheet
pnpm add inject-static-sheet
yarn add inject-static-sheet
bun add inject-static-sheet
```

## 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 | 2.0.1 |
| Published | 2018-03-15 |
| First published | 2018-03-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Dan Needham |
| Maintainers | dndhm |
| Keywords | react, jss, generateClassName, react-jss |

## Links

- npm: https://www.npmjs.com/package/inject-static-sheet
- Repository: https://github.com/dndhm/inject-static-sheet
- Homepage: https://github.com/dndhm/inject-static-sheet#readme
- Issues: https://github.com/dndhm/inject-static-sheet/issues
- npm.io page: https://npm.io/package/inject-static-sheet

## Dependencies (1)

- [react-jss](https://npm.io/package/react-jss.md) ^8.3.5

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2018-03-15
- 2.0.0 — 2018-03-15
- 1.0.0 — 2018-03-08
- 0.1.2 — 2018-03-08
- 0.1.0 — 2018-03-08

## README

## Inject Static Sheet

A wrapper for [react-jss](https://github.com/cssinjs/react-jss) `injectSheet`, resulting in deterministic className prefixing.

### Usage
Call `injectSheet` as usual, but pass an additional `prefix` argument. This will be used to fix the className prefix to a consistent string, rather than a generated hash of IDs which differ across environment (which is the default behaviour):
```
const styleSheet = {
	someClass: {...}
};
export default injectSheet(styleSheet, 'MyComponentPrefix')(MyComponent);
```
Output: `<marquee class="MyComponentPrefix--someClass">Deprecated lol</marquee>`

`generateClassName` is also available for direct use, where only the function its self needs to be overridden. This can be useful when passing as a prop to a `JssProvider`:
```
<JssProvider generateClassName={generateClassName}>
```

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