CSS Prop Clarity

Hey there –
Since the Frontity package seems to be exporting css from @emotion/code wholesale, is there any difference between passing styles to that prop as an object and as a string?

import {css} from 'frontity'

// is this equivalent
render(
<div css={{color: 'red'}}></div>
)

// to this?
render(
<div css={css`color: red`}></div>
)

Is the import required with the former?
Thanks

Hi @hey,

Not really, they’re 2 different ways of doing the same

No, if you’re not going to use the css method to generate a styles object to be passed to the css props, then you don’t need to import it