I have a component which is wrapped in a div with display: flex
Another component controls whether that other component is visible or not. The initial state is display: 'none'
and on a certain condition it will be shown. I wouldn't want to show it again by setting it to display flex, because I prefer that the component itself will be responsible for that. I would like to do something like "unset the display: none
and let the component decide how it will be shown".
const AddNewRowHoverArea = styled('div')({
height: 16,
cursor: 'pointer',
display: 'flex',
justifyContent: 'flex-end',
'& > div': {
display: 'none',
},
'&:hover div': {
display: 'flex',
},
});
Currently it's done with display: flex
. In such case is my only option is to use visibility: hidden
?
unset
value, for example,display: unset
on that other component you talked about. Or go withvisibility: hidden
. But I don't really understand what's purpose of this, since it's going to be the value going to be overridden by the down the treedisplay: flex
anyway. Please correct me if I misunderstood.&:not(:hover) > div : { display: 'none' }