cssinjs / styled-jss

Styled Components on top of JSS.
http://cssinjs.org/styled-jss
MIT License
217 stars 25 forks source link

Functions do not work with arrays #22

Open bigslycat opened 7 years ago

bigslycat commented 7 years ago

It works:

const MyComp = styled('div')({
  border: [2, 'solid', 'white'],
});

This does not work:

const MyComp = styled('div')({
  border: ({ children }) => !children && [2, 'solid', 'white'],
});

Works:

const MyComp = styled('div')({
  border: ({ children }) => !children && ['2px', 'solid', 'white'].join(' '),
});
lttb commented 7 years ago

Thanks for this issue!

It looks like a bug with JSS, see https://github.com/cssinjs/jss/issues/497