Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to create a style in one stylesheet that's overridden by styles in another stylesheet? #35

Open
fresheneesz opened this issue Feb 23, 2015 · 2 comments

Comments

@fresheneesz
Copy link

I want to do something like this:

    var jssSheet1 = jss.sheet() // returns a jss instance with a new sheet created on the document
    var jssSheet2 = jss.sheet()

    jssSheet2.set('#A', {
        color: 'red'
    })
    jssSheet1 .set('#A', {
        color: 'green'
    })

But I want the results to be that #A remains red. Is there any way I can create a style later in time that is overridden by a style that was created earlier in time?

@fresheneesz
Copy link
Author

Does jss have a way to handle different stylesheets? I asked a stackoverflow question related to this: http://stackoverflow.com/questions/28669083/how-to-dynamically-create-a-css-style-rule-that-is-overridable-by-earlier-rules?noredirect=1#comment45632627_28669083 .

It seems like even if you create two different stylesheets by craeting two separate jss objects, rules still append into the same stylesheet for some reason.

@fresheneesz
Copy link
Author

I've answered my question there btw. I'm going to open another issue to not lazily create the sheet - cause that prevent reasonable behavior with different jss instances when you're trying to work with different sheets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant