css
function is a function that returns a string.
You can use css
as a tag function to create a css string. Pass in a string of css properties as an argument, ans it will be converted
into a class list.
1const before = ( 2 <div 3 className={css` 4 color: red; 5 `} 6 /> 7) 8 9const after = <any className="d0"/> 10
1const before = ( 2 <div 3 className={css` 4 color: red; 5 `} 6 /> 7) 8 9const after = <any className="d0"/> 10
You can also use the css function by passing in a css object as an argument.
1const before = ( 2 <any 3 className={css({ 4 color: 'red', 5 })} 6 /> 7) 8 9const after = <any className="d0" />
1const before = ( 2 <any 3 className={css({ 4 color: 'red', 5 })} 6 /> 7) 8 9const after = <any className="d0" />