lewisl9029 / use-classes

Intro slides: https://build-a-css-in-js-library.lewisl.dev/, still heavily experimental, you probably don't want to be using this in production yet.
MIT License
1 stars 0 forks source link

Separate hooks for media queries and pseudo selectors #19

Closed lewisl9029 closed 2 years ago

lewisl9029 commented 2 years ago

Vast majority of calls don't need them, but end up incurring the cost for the checks anyways. Ergonomics of doing className={useStyles() + useMediaQueryStyles() + usePseudoClassStyles()} isn't all that worse compared to nesting in the same object.

Can probably beat emotion and styled components once we do this.

lewisl9029 commented 2 years ago

Also, we can manually make media queries take precedence over regular styles by using a separate stylesheet.