css-toggle icon indicating copy to clipboard operation
css-toggle copied to clipboard

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

Open dbaron opened this issue 1 year ago • 0 comments

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).

dbaron avatar Nov 09 '22 01:11 dbaron