Skip to content

Instantly share code, notes, and snippets.

@jameshopkins
Last active August 29, 2015 14:09
Show Gist options
  • Save jameshopkins/d60c18d66b5c46afb3f7 to your computer and use it in GitHub Desktop.
Save jameshopkins/d60c18d66b5c46afb3f7 to your computer and use it in GitHub Desktop.
React CSS in JS

##Implementation issues

###How do we expose declaration blocks from at rules? CSSMediaRule instances could be exposed as flags through the content property of a pseudo element (applied to html/body?), and consumed through getComputedStyle. What about other forms?

###How do we deal with merging property shorthands? { background: red }, { background: url('...') yellow }

Unable to use pseudo classes/elements

The 'style' attribute can only contain property declarations

@jameshopkins
Copy link
Author

I agree that you can replicate user-interaction pseudo classes (:hover, :active and :focus) relatively easily. However, for every other category, we'd end up introducing a neutral element purely for the purpose of styling :(

hover should be considered a mandatory accessibility requirement in most projects, so it needs to be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment