Skip to content

v2.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 24 Jul 14:40
· 25 commits to main since this release
ac2c5ff

Major Changes

  • 25e06c5: Multi-binding properties are now additive

    In Corset 2.0, multi-binding properties are now additive. That means if you use the class-toggle, each, prop, data, or attr properties, the values you set will be added to the element, but will not remove previous values added.

    In Corset 1.0 these multi-binding properties were destructive. This meant if you did:

    #app {
      class-toggle: one true;
    }
    
    #app {
      class-toggle: two true;
    }

    Only the two class would be on the element. In Corset 2.0 both one and two will be set.

    revert-sheet and all keywords

    To allow you to remove previous bindings, Corset 2.0 has new revert-sheet and all keywords. To remove previous bindings, as in above, you would now do:

    #app {
      class-toggle: one true;
    }
    
    #app {
      class-toggle: all revert-sheet, two true;
    }

    Using all selects all active bindings for that property.

    Keyed property access removed

    Due to the change in making multi-binding properties be additive, there is no longer a need for keyed property access, and it has thereby been removed. This aligns Corset syntax with CSS.

    In the future no new syntax not supported by CSS will be added to Corset.

  • 0e4c74b: Removes keyed properties and makes properties default additive

Minor Changes

  • 8abb1ee: Child behaviors now cause the parent to rebind
  • 06bd259: Allow the :root selector for targeting the root element

Patch Changes

  • 5d3b461: Fixes bugs based on vars not being resolvable
  • b76dfa5: On conflict between attach-template and text, former wins
  • 921c26e: Allows a ShadowRoot to be a root element of a sheet
  • 76b0c7a: Allow mount() to take a ShadowRoot
  • de0927e: Fix bug with attach-template and vars
  • 80fd8bf: When a data prop changes, rebind the sheet