jxnblk / understyle

Functional style utilities for authoring JavaScript style objects

Home Page:http://jxnblk.com/understyle/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unpredictable responsive class overrides

pstoica opened this issue · comments

Using arrays for responsive properties has issues if you do something like this:

<div>
  <Box bg="red"></Box>
  {/* later... */}
  <Box bg={['red', 'white']}></Box>
</div>

I think the .bg-red class gets created before the white responsive class because of the rendering order, meaning the second box is only ever red.

Maybe a solution is to use important in responsive classes and make sure those are sorted by breakpoint?

EDIT: sorry, I think this belongs in https://github.com/jxnblk/cxs