cssinjs / cssinjs/jss

Documentation does not reflect actual implementation

Open
#1,540 0 comments 0 reactions 0 assignees View on GitHub
docs
Dominant language
JavaScript
Stars
7.1k
Forks
386
PR merge metrics
No merged PRs in 30d

Description

__Expected behavior:__
Refering to the [docs](https://cssinjs.org/jss-api/?v=v10.7.1#add-a-rule-dynamically), one should be able to use it like so:

```
const rule = sheet.addRule({ … })
document.body.innerHTML = `Button`
```

but `rule.className` is undefined.

I have had a look into the source and could not find any trace for the mentioned »className« property. Right now I am using `rule.id`. That is working somehow, but not included in the typings - so: `(rule as any).id` is what I am using. But that feels hackish and not to be the intended way.

So how is it intended to be used?

__Versions:__
- jss: ^10.7.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.