ripple@0.3.126
·
20 commits
to main
since this release
Patch Changes
-
#1441
2404ad4
Thanks @leonidaz! - Implement sibling-scoped
<style>blocks,$class, andapply
(TSRX RFC #1) for the Ripple
target.- A
<style>block is scoped to its siblings: it styles the items beside it and
everything below them, never the element that contains it. Blocks among the
same children share one hash and one stylesheet; nested children lists that
hold blocks are nested scopes, and every element carries the hash of each
enclosing scope, outer first. Control-flow branches and templates assigned to
variables host scopes too. - Assigning a block to a variable exposes
$class. Exported, applied, or
$class-read blocks are themes that keep every selector; other assigned
blocks stay class maps.<style apply={theme} />attaches a theme to a whole
scope,<style apply={theme}>…</style>applies and declares in one tag,
arrays apply several themes, and a theme may apply other themes. Same-module
themes inline as literals; imported themes are read throughtheme.$classat
runtime. - CSS is emitted in lexical order (an applied theme before the block that
applies it, a scope's blocks together, nested scopes after their parent). On
the server a render registers the sheets it needs in that order, class-map
reads register their own sheet, and readingtheme.$classoutside a render no
longer throws. - The style diagnostics of the RFC (
tsrx-style-*codes) are reported, and
type-only output verifiesapplytargets through a$classread. - Fixed: a
@{ … }block rendered as the child of a DOM element on the client
was dropped; it now renders in place. The#classspread attribute accepts
several class tokens.
Raw CSS in a
<style>inside a plain function that returns JSX is now an error
(tsrx-style-standalone-outside-template): use a@{ … }body, or
<style>{css}</style>. Elements are stamped with the scope class after their
authored classes, and every element of a scope carries it, not only those a
selector matches. - A
-
Updated dependencies
[2404ad4]:- @tsrx/ripple@0.1.63