Skip to content

Instantly share code, notes, and snippets.

@audiolion
Created January 2, 2020 20:12
Show Gist options
  • Save audiolion/b1df50a71cf7b8b2a0a949a1fdc7bf87 to your computer and use it in GitHub Desktop.
Save audiolion/b1df50a71cf7b8b2a0a949a1fdc7bf87 to your computer and use it in GitHub Desktop.
<div css={{
color: 'red',
...(isActive ? color: 'blue' : {}),
}} />
<div css={[
{ color: 'red' },
isActive ? { color: 'blue' } : undefined,
]} />
const activeStyle = css({ color: 'blue' })
<div css={[
{ color: 'red' },
isActive ? activeStyle : undefined,
]} />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment