You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `css` tag (analogous to `html`) builds `ElementStyles` objects. During `ElementController.connect()`, styles are applied to the element's shadow root either via `adoptedStylesheets` (preferred) or an appended `<style>` node, depending on platform support. Styles can also contain dynamic `CSSDirective`s (e.g., CSS custom property bindings) that register as `HostBehavior`s and connect/disconnect alongside the element. Arbitrary runtime style toggling is handled through `ElementController.addStyles()` / `removeStyles()`; `ElementStyles` itself is a static container and does not expose a public behavior-mutation API.
275
+
The `css` tag (analogous to `html`) builds `ElementStyles` objects. During `ElementController.connect()`, styles are applied to the element's shadow root either via `adoptedStylesheets` (preferred) or an appended `<style>` node, depending on platform support. `CSSDirective`s can contribute additional static CSS during template composition, but runtime CSS bindings and style-attached `HostBehavior`s are not supported. Arbitrary runtime style toggling is handled through `ElementController.addStyles()` / `removeStyles()`; `ElementStyles` itself is a static container.
Copy file name to clipboardExpand all lines: packages/fast-element/MIGRATION.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,14 +109,19 @@ The `install-hydratable-view-templates.js` side-effect import is still available
109
109
| Removed | Replacement |
110
110
|---|---|
111
111
|`ElementStyles.withBehaviors()`| Move the runtime condition into the element and call `this.$fastController.addStyles()` / `this.$fastController.removeStyles()` directly. |
112
+
|`ElementStyles.behaviors`| Move any runtime behavior out of the stylesheet and into the element or controller lifecycle. |
113
+
| CSS bindings in `css` (for example ``css`color: ${x => x.color}```) | Move the dynamic value into the element and update classes, attributes, or inline styles from element code. |
114
+
|`CSSDirective.createCSS(add)`| Update directives to implement `createCSS()` and return only static CSS content. |
112
115
113
116
### Changed behavior
114
117
115
-
-`css` and `css.partial()` still compose internal behaviors for CSS directives and CSS bindings.
116
-
-`ElementStyles` remains a static style container; attaching arbitrary `HostBehavior`s is no longer part of the public API.
118
+
-`css` and `css.partial()` no longer compose `HostBehavior`s.
119
+
-`css` no longer accepts function or `Binding` interpolations.
120
+
-`ElementStyles` is now a fully static style container.
117
121
118
122
### Migration steps
119
123
120
124
1. Keep the conditional `ElementStyles` in a separate `css` value.
121
125
2. Move the external listener or condition (for example `matchMedia()` or an app event subscription) into the element lifecycle.
122
126
3. Call `this.$fastController.addStyles(styles)` when the condition is active and `this.$fastController.removeStyles(styles)` when it is inactive or during cleanup.
127
+
4. If you previously interpolated bindings or behavior-producing directives into `css`, replace them with element state and standard DOM or controller updates.
// dist/dts/components/fast-element.d.ts:60:5 - (ae-forgotten-export) The symbol "define" needs to be exported by the entry point index.d.ts
1115
1090
// dist/dts/components/fast-element.d.ts:61:5 - (ae-forgotten-export) The symbol "compose" needs to be exported by the entry point index.d.ts
1116
1091
// dist/dts/components/fast-element.d.ts:62:5 - (ae-forgotten-export) The symbol "from" needs to be exported by the entry point index.d.ts
1117
-
// dist/dts/styles/css-binding-directive.d.ts:35:9 - (ae-forgotten-export) The symbol "CSSBindingEntry" needs to be exported by the entry point index.d.ts
1118
1092
1119
1093
// (No @packageDocumentation comment for this package)
0 commit comments