@vaadin/vaadin-lumo-styles 24.1.0-alpha2 → 24.1.0-alpha3

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.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import { badge } from './badge.js';
7
+ import { addLumoGlobalStyles } from './global.js';
8
+
9
+ addLumoGlobalStyles('badge', badge);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import { color } from './color.js';
7
+ import { addLumoGlobalStyles } from './global.js';
8
+
9
+ addLumoGlobalStyles('color', color);
package/color.js CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import './version.js';
7
7
  import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
+ import { addLumoGlobalStyles } from './global.js';
8
9
 
9
10
  const colorBase = css`
10
11
  :host {
@@ -80,9 +81,7 @@ const colorBase = css`
80
81
  }
81
82
  `;
82
83
 
83
- const $tpl = document.createElement('template');
84
- $tpl.innerHTML = `<style>${colorBase.toString().replace(':host', 'html')}</style>`;
85
- document.head.appendChild($tpl.content);
84
+ addLumoGlobalStyles('color-props', colorBase);
86
85
 
87
86
  const color = css`
88
87
  [theme~='dark'] {
package/global.js ADDED
@@ -0,0 +1,12 @@
1
+ const prefix = 'lumo-';
2
+
3
+ export const addLumoGlobalStyles = (id, ...styles) => {
4
+ const styleTag = document.createElement('style');
5
+ styleTag.id = `${prefix}${id}`;
6
+ styleTag.textContent = styles
7
+ .map((style) => style.toString())
8
+ .join('\n')
9
+ .replace(':host', 'html');
10
+
11
+ document.head.insertAdjacentElement('afterbegin', styleTag);
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/vaadin-lumo-styles",
3
- "version": "24.1.0-alpha2",
3
+ "version": "24.1.0-alpha3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -41,8 +41,8 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@polymer/polymer": "^3.0.0",
44
- "@vaadin/icon": "24.1.0-alpha2",
45
- "@vaadin/vaadin-themable-mixin": "24.1.0-alpha2"
44
+ "@vaadin/icon": "24.1.0-alpha3",
45
+ "@vaadin/vaadin-themable-mixin": "24.1.0-alpha3"
46
46
  },
47
47
  "devDependencies": {
48
48
  "gulp": "^4.0.2",
@@ -51,5 +51,5 @@
51
51
  "gulp-sort": "^2.0.0",
52
52
  "gulp-svgmin": "^4.1.0"
53
53
  },
54
- "gitHead": "9e3ee2557109030f2aba59e17a84e4e121d699c0"
54
+ "gitHead": "077b4a8e8fff063b9eba4581af81f9e152cb852d"
55
55
  }
package/sizing.js CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import './version.js';
7
7
  import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
+ import { addLumoGlobalStyles } from './global.js';
8
9
 
9
10
  const sizing = css`
10
11
  :host {
@@ -23,8 +24,6 @@ const sizing = css`
23
24
  }
24
25
  `;
25
26
 
26
- const $tpl = document.createElement('template');
27
- $tpl.innerHTML = `<style>${sizing.toString().replace(':host', 'html')}</style>`;
28
- document.head.appendChild($tpl.content);
27
+ addLumoGlobalStyles('sizing-props', sizing);
29
28
 
30
29
  export { sizing };
package/spacing.js CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import './version.js';
7
7
  import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
+ import { addLumoGlobalStyles } from './global.js';
8
9
 
9
10
  const spacing = css`
10
11
  :host {
@@ -31,8 +32,6 @@ const spacing = css`
31
32
  }
32
33
  `;
33
34
 
34
- const $tpl = document.createElement('template');
35
- $tpl.innerHTML = `<style>${spacing.toString().replace(':host', 'html')}</style>`;
36
- document.head.appendChild($tpl.content);
35
+ addLumoGlobalStyles('spacing-props', spacing);
37
36
 
38
37
  export { spacing };
package/style.js CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import './version.js';
7
7
  import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
+ import { addLumoGlobalStyles } from './global.js';
8
9
 
9
10
  const style = css`
10
11
  :host {
@@ -36,8 +37,6 @@ const globals = css`
36
37
  }
37
38
  `;
38
39
 
39
- const $tpl = document.createElement('template');
40
- $tpl.innerHTML = `<style>${style.toString().replace(':host', 'html')}$</style>`;
41
- document.head.appendChild($tpl.content);
40
+ addLumoGlobalStyles('style-props', style);
42
41
 
43
42
  export { globals, style };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import { addLumoGlobalStyles } from './global.js';
7
+ import { typography } from './typography.js';
8
+
9
+ addLumoGlobalStyles('typography', typography);
package/typography.js CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import './version.js';
7
7
  import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
+ import { addLumoGlobalStyles } from './global.js';
8
9
 
9
10
  const font = css`
10
11
  :host {
@@ -123,9 +124,6 @@ const typography = css`
123
124
  `;
124
125
 
125
126
  registerStyles('', typography, { moduleId: 'lumo-typography' });
126
-
127
- const $tpl = document.createElement('template');
128
- $tpl.innerHTML = `<style>${font.toString().replace(':host', 'html')}</style>`;
129
- document.head.appendChild($tpl.content);
127
+ addLumoGlobalStyles('typography-props', font);
130
128
 
131
129
  export { font, typography };
package/user-colors.js CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import './version.js';
7
7
  import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
+ import { addLumoGlobalStyles } from './global.js';
8
9
 
9
10
  const userColors = css`
10
11
  :host {
@@ -28,8 +29,5 @@ const userColors = css`
28
29
  }
29
30
  `;
30
31
 
31
- const $tpl = document.createElement('template');
32
- $tpl.innerHTML = `<style>${userColors.toString().replace(':host', 'html')}</style>`;
33
- document.head.appendChild($tpl.content);
34
-
32
+ addLumoGlobalStyles('user-color-props', userColors);
35
33
  export { userColors };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import { addLumoGlobalStyles } from './global.js';
7
+ import { utility } from './utility.js';
8
+
9
+ addLumoGlobalStyles('utility', utility);
package/version.js CHANGED
@@ -12,7 +12,7 @@
12
12
  */
13
13
  class Lumo extends HTMLElement {
14
14
  static get version() {
15
- return '24.1.0-alpha2';
15
+ return '24.1.0-alpha3';
16
16
  }
17
17
  }
18
18