Closed Fabioni closed 2 months ago
If your'e looking for something that can be used for styling, or for e2e tests, then attributes like data-panel-collapsible
and data-panel-size
already exist (e.g. data-panel-size="0"
is collapsed)
data-panel-size will have the collapsedSize and not 0, so it is not logically to use that.
If the collapsed size is not zero, then it will have whatever the collapsed size is. You know that size, Because you pass it in as a prop, so you can write your selector accordingly.
It's feels more idiomatic to have a dedicated data attribute for that. Otherwise I need to change a css/tailwind value somewhere else in the code if I change the collapsedSize value which is weird. Also css could be applied to many panels which all could have different collapsedSizes. Whether a panel is collapsed or not is idiomatic a different information than the current size of it, so it should also have separate representations.
Can we have a class or data attribute in the panel that toggles when the panel is collapsed? Currently we can only use onCollapse and onExpand, but that is kind of overkill for just styling.