tabatkins / css-toggle

Proposal for a CSS Toggle spec
Creative Commons Zero v1.0 Universal
28 stars 1 forks source link

Do we need a one-directional (UA -> toggle state) variant of toggle-visibility? #45

Open dbaron opened 2 years ago

dbaron commented 2 years ago

I think it's possible that it would be good to have a one-directional variant of toggle-visibility. Currently toggle-visibility does two things:

  1. It hides/shows the element based on the state of the toggle
  2. It changes the state of the toggle if a UA feature such as find-in-page wants to show the contents of the element.

I think there are use cases that may want (2) but not (1). For example, in a carousel where the selected pane is visible, but edges of the adjacent panes are also visible, part (1) might be inappropriate, and the style sheet might want to hide the other panes using some other mechanism (e.g., transforms and clipping). However, if this is necessary, it might be undesirable to give up the features of (2).