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

Idea: parameter for applyTo to use generated class name vs inline style. #35

Closed
trusktr opened this issue Dec 28, 2014 · 1 comment
Closed
Labels
idea What if we turn JSS into styled-components?

Comments

@trusktr
Copy link

trusktr commented Dec 28, 2014

Applying the generated class name with applyTo might even be better because it then allows for the opportunity to override things with inline styles without losing the previous styles. Maybe applyTo can have an extra parameter to specify if the style is applied by class name, or inline.

rule.applyTo(el) // adds the rule.className, without overriding stuff.
rule.applyTo(el, true) // style applied inline to element, overrides stuff.

This also led me to think of the idea in #36.

If cssText happens to be faster, then we can swap what true refers to, so that rule.applyTo(el) without the second parameter defaults to whichever is ultimately faster, but I think className will win. Doing some more research on the async rendering stuff...

@kof
Copy link
Member

kof commented Dec 28, 2014

adding class currently designed like this: element.className = sheet.classes.bla or element.classList.add(sheet.classes.bla)

I would not mix this two things ....

@kof kof added the idea What if we turn JSS into styled-components? label Dec 28, 2014
@kof kof closed this as completed Sep 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea What if we turn JSS into styled-components?
Projects
None yet
Development

No branches or pull requests

2 participants