tabatkins / css-toggle

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

Persisting Toggles #17

Open bramus opened 2 years ago

bramus commented 2 years ago

I’m wondering if persisting toggles will be covered. Would come in handy for persisting things like color choices, active tabs, etc.

To easily do so I’m thinking of a change event in the scripting API one can listen to. That way the toggle value can be captured and persisted in local storage or the like.

On Twitter, user Jan Nicklas wondered about a pure CSS way of doing so, and suggested a toggle-lifetime property. Seems like a logical request, but I can imagine there are some security/privacy implications that come along with this.