I'm looking for the answer to the question how should I use styles with conditional operators.
What code example would be the best? Can we use non-CSS values such as undefined, null, false, etc.?
margin: isOpen ? '10px' : undefined
margin: isOpen ? '10px' : 'initial'
Is it okay to use it in that way? (so we pass 'undefined' and 'null' as a css property)
margin: isOpen ?? '10px'
and one more (so we pass every falsie value)
margin: isOpen && '10px'
or maybe this
margin: isOpen ? '10px' : ''
As context we can say we wanna use it in react style porp, or in styled-components

Use
unsetto reset the property to its inherited value. More on the subject here:https://developer.mozilla.org/en-US/docs/Web/CSS/unset
The way you design your if else statement would be unopinionated, as long as you don't set an
undefinedornullor any value not allowed for margin, all is good.