threepointone/glamor

css={} is same as {...style({})}?

Closed this issue · 2 comments

Correct?

Finding {...merge(` for media queries, pseudo styles to be somewhat cumbersome.

Would rather things just be nested within styles/css

Would rather just write something like:

css={{
  lineHeight: 1.3,
  marginBottom: 16,
  [presets.tablet]: {
    marginBottom: 32,
  },
  [presets.hd]: {
    marginBottom: 40,
  },
}}

nested pseudo styles work, nested media queries don't work (yet), however yes, css={{}} works. it also accepts arrays, so the following works

css={[{
  lineHeight: 1.3,
  marginBottom: 16,
  ':hover': {
    fontWeight: 'bold'
  }  
}, media(presets.tablet, {
    marginBottom: 32,
  }),
  media(presets.hd, {
    marginBottom: 40,
  })]}

I have an open issue for nested media queries, will get to it after my roadtrip.

Ok perfect. Since it accepts arrays that'll hold me over until nested media queries are ready. 💯