Cotomy v2.0.4

Patch release that improves CotomyElement scoped CSS handling by auto-prefixing each selector when scoped CSS is written without an explicit root placeholder, including nested style rules where appropriate.

Overview

Cotomy v2.0.4 is a patch release focused on scoped CSS handling in CotomyElement.

The release improves how scoped CSS is generated when CSS is written without an explicit root placeholder. Cotomy now scopes each selector rather than only prefixing the stylesheet once.

Changes

Before this release, scoped CSS without a root placeholder was normalized by adding the scoped root to the beginning of the CSS text. That worked for simple single-selector rules, but it was too broad for stylesheets that contained multiple selectors or nested style rules.

v2.0.4 changes the scoped CSS generation path so selector lists are handled per selector. CSS that already uses the root placeholder still maps that placeholder to the element scope. CSS that omits the placeholder is now prefixed selector by selector.

The release also keeps nested style rules scoped where that is appropriate, such as media, supports, container, layer, and document rules, while preserving non-style at-rules such as keyframes.

Tests

The release adds tests for scoped CSS auto-prefixing across multiple selectors, selectors with functions such as is(), and nested rules that should preserve non-style at-rules.

Install

npm install [email protected]

Links

https://github.com/yshr1920/cotomy/releases/tag/v2.0.4
https://cotomy.net

Related Articles

Introducing Cotomy , CotomyElement in Practice , Cotomy v2.0.3

Learn Cotomy

Cotomy is a DOM-first UI runtime for long-lived business applications.