matthewp / corset

Declarative data bindings, bring your own backend.

Home Page:https://corset.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to target the root element

matthewp opened this issue · comments

Currently you can't target the root element. This means you wind up using wrappers more than you'd like. One area where this is frustrating is adding a behavior to a specific element that might not even have children.

I think the fix would be a custom selector, maybe something like :corset-root that would allow targeting the root:

:corset-root {
  class-toggle[testing]: true;
}

To add this feature we first need to parse selectors, which doesn't happen at the moment.