tabatkins / css-toggle

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

toggle creation/replacement model is a bit unclear #20

Open dbaron opened 2 years ago

dbaron commented 2 years ago

3. Creating a Toggle: the toggle-root property says:

In addition to specifying how to create new toggles, a toggle specifier overrides the existing toggle’s states, overflow, and group, if they differ, allowing an existing toggle to have its behavior changed if necessary.

It is notable that this list does not include the scope. Does this imply that if the scope in a specifier changes, you end up with two toggles with the same name on the same element, with different scopes? Or should it list scope as well?

Also, this statement seems to contradict 2. Toggle Concepts, which says:

Once created, none of their items are affected by CSS, and only their value can be changed by user interaction.

tabatkins commented 2 years ago

It is notable that this list does not include the scope. Does this imply that if the scope in a specifier changes, you end up with two toggles with the same name on the same element, with different scopes? Or should it list scope as well?

It definitely shouldn't make another one. It probably should list scope, I'll have to look closely at this.

Also, this statement seems to contradict 2. Toggle Concepts, which says:

It's not contradictory - the values aren't changed, they can just be overridden at time-of-use. But it's definitely phrased somewhat confusingly. ^_^

dbaron commented 2 years ago

Oh, I realized that if scope should override, that overriding should be in the fire a toggle activation algorithm.

dbaron commented 2 years ago

(Though I think making scope override would make things a good bit harder; it's probably easier as-is.)