cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.06k stars 397 forks source link

Documentation - clarify where `link: true` goes #738

Closed brianmhunt closed 6 years ago

brianmhunt commented 6 years ago

The JSS docs on observables mentions that one needs to use link: true, but does not mention where.

For example, given:

    this.styles = jss.createStyleSheet(this.css).attach()

It's not clear which of the following is correct:

    this.styles = jss.createStyleSheet(this.css, {link: true}).attach()
    this.styles = jss.createStyleSheet(this.css).attach({link: true})

Seems like it's neither; rather, if you trace .attach, it looks like it uses this.options.link, but the expected jss.options is undefined.

All to say, there's a gap that needs to be filled about where link: true goes.

HenriBeck commented 6 years ago

Here it says that observables need the Sheet option link: true.

Also the options for a Sheet a declared here: https://github.com/cssinjs/jss/blob/master/docs/js-api.md#create-style-sheet

But I think we could add an example with how to use observables.

brianmhunt commented 6 years ago

Thanks @HenriBeck ; the ambiguity is whether the Sheet option is on the attach or the create call.

kof commented 6 years ago

I don't get it, how did you come to think .attach() accepts an options argument? Please send a PR where you think its not clear.

brianmhunt commented 6 years ago

@kof Trivial fix that would've saved 10-15 minutes of wandering around the docs is #739

kof commented 6 years ago

yeah, I guess docs will never be perfect, thats one every one needs to send fixes like this one :)