Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

Improvement to element creation DSL

Compare
Choose a tag to compare
@sanity sanity released this 31 Oct 14:01
· 384 commits to master since this release
04e33a4

This release changes how Elements are configured on creation. Old approach:

button {
   element {
      classes("bigbutton")
      this["autofocus"] = true
      text("Click Me!")
   }
}

New approach:

button { btnEl ->
    with(btnEl) {
        classes("bigbutton")
        this["autofocus"] = true
        text("Click Me!")
    }
}

The element { } block is now deprecated in favor of this approach.

What's Changed

  • New approach to configuring elements by @sanity in #366

Full Changelog: 1.0.2.1...1.1.0