@vaadin/vaadin-themable-mixin 25.0.0-beta7 → 25.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/vaadin-themable-mixin",
3
- "version": "25.0.0-beta7",
3
+ "version": "25.0.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -33,15 +33,15 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@open-wc/dedupe-mixin": "^1.3.0",
36
- "@vaadin/component-base": "25.0.0-beta7",
36
+ "@vaadin/component-base": "~25.0.0",
37
37
  "lit": "^3.0.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@polymer/polymer": "^3.0.0",
41
- "@vaadin/chai-plugins": "25.0.0-beta7",
42
- "@vaadin/test-runner-commands": "25.0.0-beta7",
41
+ "@vaadin/chai-plugins": "~25.0.0",
42
+ "@vaadin/test-runner-commands": "~25.0.0",
43
43
  "@vaadin/testing-helpers": "^2.0.0",
44
44
  "sinon": "^21.0.0"
45
45
  },
46
- "gitHead": "f12f14c37d2c0a72f708baff4a95230168d58dcc"
46
+ "gitHead": "c979f7ca278b6412095176ada230eb07eb4456bf"
47
47
  }
@@ -1,9 +1,6 @@
1
- import type { CSSResultGroup } from 'lit';
2
-
3
1
  /**
4
2
  * @license
5
3
  * Copyright (c) 2017 - 2025 Vaadin Ltd.
6
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
7
5
  */
8
6
  export { registerStyles, css, unsafeCSS } from './vaadin-themable-mixin.js';
9
- export const addGlobalThemeStyles: (id: string, ...styles: CSSResultGroup[]) => void;
@@ -4,20 +4,3 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  export { registerStyles, css, unsafeCSS } from './vaadin-themable-mixin.js';
7
-
8
- /**
9
- * This is for use internally by Lumo and Material styles.
10
- *
11
- * @param {string} id the id to set on the created element, only for informational purposes
12
- * @param {CSSResultGroup[]} styles the styles to add
13
- */
14
- export const addGlobalThemeStyles = (id, ...styles) => {
15
- const styleTag = document.createElement('style');
16
- styleTag.id = id;
17
- styleTag.textContent = styles
18
- .map((style) => style.toString())
19
- .join('\n')
20
- .replace(':host', 'html');
21
-
22
- document.head.insertAdjacentElement('afterbegin', styleTag);
23
- };
@@ -97,6 +97,23 @@ export class LumoInjector {
97
97
  this.#componentsByTag.values().forEach((components) => components.forEach(removeLumoStyleSheet));
98
98
  }
99
99
 
100
+ /**
101
+ * Forces all monitored components to re-evaluate and update their
102
+ * injected styles.
103
+ *
104
+ * This method can be used to force LumoInjector to clean up component
105
+ * styles synchonously after the Lumo stylesheet has been removed from
106
+ * the root element. Without this, there may be a short FOUC, when the
107
+ * Lumo styles are already removed from the root but still present in
108
+ * the component Shadow DOMs, since those are removed asynchronously on
109
+ * `transitionstart` (CSSPropertyObserver).
110
+ */
111
+ forceUpdate() {
112
+ for (const tagName of this.#styleSheetsByTag.keys()) {
113
+ this.#updateStyleSheet(tagName);
114
+ }
115
+ }
116
+
100
117
  /**
101
118
  * Adds a component to the list of elements monitored for style injection.
102
119
  * If the styles have already been detected, they are injected into the