@db-ux/core-foundations 4.5.4-tailwind-inline-5d37a00 → 4.6.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.
Files changed (108) hide show
  1. package/CHANGELOG.md +31 -21
  2. package/README.md +16 -69
  3. package/agent/_instructions.md +35 -0
  4. package/agent/tailwind/Variables.md +11 -9
  5. package/build/styles/bundle.css +4820 -0
  6. package/build/styles/{index.scss → bundle.scss} +5 -0
  7. package/build/styles/colors/_default-color-mappings.scss +3461 -3472
  8. package/build/styles/colors/_placeholder.scss +155 -159
  9. package/build/styles/colors/classes/all.css +2499 -2601
  10. package/build/styles/colors/classes/blue.css +147 -185
  11. package/build/styles/colors/classes/brand.css +147 -185
  12. package/build/styles/colors/classes/burgundy.css +147 -185
  13. package/build/styles/colors/classes/critical.css +147 -185
  14. package/build/styles/colors/classes/cyan.css +147 -185
  15. package/build/styles/colors/classes/green.css +147 -185
  16. package/build/styles/colors/classes/informational.css +147 -185
  17. package/build/styles/colors/classes/light-green.css +147 -185
  18. package/build/styles/colors/classes/neutral.css +147 -185
  19. package/build/styles/colors/classes/orange.css +147 -185
  20. package/build/styles/colors/classes/pink.css +147 -185
  21. package/build/styles/colors/classes/red.css +147 -185
  22. package/build/styles/colors/classes/successful.css +147 -185
  23. package/build/styles/colors/classes/turquoise.css +147 -185
  24. package/build/styles/colors/classes/violet.css +147 -185
  25. package/build/styles/colors/classes/warning.css +147 -185
  26. package/build/styles/colors/classes/yellow.css +147 -185
  27. package/build/styles/defaults/default-code.css +97 -97
  28. package/build/styles/defaults/default-container-properties.css +1 -0
  29. package/build/styles/defaults/default-container-variables.css +1 -0
  30. package/build/styles/defaults/default-elevation.css +1 -1
  31. package/build/styles/defaults/default-fonts.css +1 -1
  32. package/build/styles/defaults/default-icons.css +1 -1
  33. package/build/styles/defaults/default-properties.css +1 -0
  34. package/build/styles/defaults/default-required.css +1 -1
  35. package/build/styles/defaults/default-required.scss +13 -16
  36. package/build/styles/defaults/default-root.css +97 -97
  37. package/build/styles/defaults/default-variables.css +1 -0
  38. package/build/styles/density/_scaling-placeholder.scss +51 -54
  39. package/build/styles/density/_typography-placeholder.scss +54 -60
  40. package/build/styles/density/classes/all.css +759 -907
  41. package/build/styles/density/classes/expressive.css +255 -377
  42. package/build/styles/density/classes/functional.css +255 -377
  43. package/build/styles/density/classes/regular.css +255 -377
  44. package/build/styles/fonts/_font-sizes.scss +10 -16
  45. package/build/styles/fonts/absolute.scss +1 -1
  46. package/build/styles/fonts/classes/all.css +54 -214
  47. package/build/styles/fonts/classes/body/2xl.css +3 -95
  48. package/build/styles/fonts/classes/body/2xs.css +3 -95
  49. package/build/styles/fonts/classes/body/3xl.css +3 -95
  50. package/build/styles/fonts/classes/body/3xs.css +3 -95
  51. package/build/styles/fonts/classes/body/all.css +27 -151
  52. package/build/styles/fonts/classes/body/lg.css +3 -95
  53. package/build/styles/fonts/classes/body/md.css +3 -95
  54. package/build/styles/fonts/classes/body/sm.css +3 -95
  55. package/build/styles/fonts/classes/body/xl.css +3 -95
  56. package/build/styles/fonts/classes/body/xs.css +3 -95
  57. package/build/styles/fonts/classes/headline/2xl.css +3 -95
  58. package/build/styles/fonts/classes/headline/2xs.css +3 -95
  59. package/build/styles/fonts/classes/headline/3xl.css +3 -95
  60. package/build/styles/fonts/classes/headline/3xs.css +3 -95
  61. package/build/styles/fonts/classes/headline/all.css +27 -151
  62. package/build/styles/fonts/classes/headline/lg.css +3 -95
  63. package/build/styles/fonts/classes/headline/md.css +3 -95
  64. package/build/styles/fonts/classes/headline/sm.css +3 -95
  65. package/build/styles/fonts/classes/headline/xl.css +3 -95
  66. package/build/styles/fonts/classes/headline/xs.css +3 -95
  67. package/build/styles/fonts/relative.scss +1 -1
  68. package/build/styles/fonts/rollup.scss +1 -1
  69. package/build/styles/fonts/webpack.scss +1 -1
  70. package/build/styles/helpers/_index.scss +0 -1
  71. package/build/styles/helpers/classes/all.css +0 -34
  72. package/build/styles/helpers/classes/divider.css +0 -34
  73. package/build/styles/helpers/classes/focus.css +0 -34
  74. package/build/styles/icons/absolute.css +1 -1
  75. package/build/styles/icons/absolute.scss +1 -1
  76. package/build/styles/icons/relative.css +1 -1
  77. package/build/styles/icons/relative.scss +1 -1
  78. package/build/styles/icons/rollup.css +1 -1
  79. package/build/styles/icons/rollup.scss +1 -1
  80. package/build/styles/icons/webpack.css +1 -1
  81. package/build/styles/icons/webpack.scss +1 -1
  82. package/build/styles/theme/absolute.css +1 -0
  83. package/build/styles/theme/relative.css +1 -0
  84. package/build/styles/{defaults/default-theme.scss → theme/relative.scss} +3 -6
  85. package/build/styles/theme/rollup.css +1 -0
  86. package/build/styles/theme/webpack.css +1 -0
  87. package/build/tailwind/theme/colors.css +0 -34
  88. package/build/tailwind/theme/dimensions.css +1 -1
  89. package/package.json +4 -4
  90. package/build/styles/absolute.css +0 -10635
  91. package/build/styles/defaults/default-theme.css +0 -97
  92. package/build/styles/helpers/_layer.scss +0 -1
  93. package/build/styles/index.css +0 -4907
  94. package/build/styles/relative.css +0 -10635
  95. package/build/styles/relative.scss +0 -4
  96. package/build/styles/rollup.css +0 -10635
  97. package/build/styles/webpack.css +0 -10635
  98. /package/build/styles/defaults/{_default-container-properties.scss → default-container-properties.scss} +0 -0
  99. /package/build/styles/defaults/{_default-container-variables.scss → default-container-variables.scss} +0 -0
  100. /package/build/styles/defaults/{_default-properties.scss → default-properties.scss} +0 -0
  101. /package/build/styles/defaults/{_default-variables.scss → default-variables.scss} +0 -0
  102. /package/build/styles/{_absolute.assets-paths.scss → theme/_absolute.assets-paths.scss} +0 -0
  103. /package/build/styles/{_default.assets-paths.scss → theme/_default.assets-paths.scss} +0 -0
  104. /package/build/styles/{_rollup.assets-paths.scss → theme/_rollup.assets-paths.scss} +0 -0
  105. /package/build/styles/{_webpack.assets-paths.scss → theme/_webpack.assets-paths.scss} +0 -0
  106. /package/build/styles/{absolute.scss → theme/absolute.scss} +0 -0
  107. /package/build/styles/{rollup.scss → theme/rollup.scss} +0 -0
  108. /package/build/styles/{webpack.scss → theme/webpack.scss} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @db-ux/core-foundations
2
2
 
3
+ ## 4.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - refactor: exclude whitelabel-theme from default bundle to reduce size and to align with "how to import a theme" - [see commit f272967](https://github.com/db-ux-design-system/core-web/commit/f272967acb7a37dc9b07d9786134e437b284e9b6)
8
+
9
+ ### Patch Changes
10
+
11
+ - fix: issue with tailwind duplicating some classes by using `@theme` inline - [see commit 92de4e6](https://github.com/db-ux-design-system/core-web/commit/92de4e6e5fdad3be5629d7457944d3b9b7396cf4)
12
+
3
13
  ## 4.5.4
4
14
 
5
15
  ### Patch Changes
@@ -107,28 +117,28 @@ _version bump_
107
117
  ### Patch Changes
108
118
 
109
119
  - chore: update instructions files for better copilot outputs - [see commit e4bc905](https://github.com/db-ux-design-system/core-web/commit/e4bc90508479387371d816d5776f9f568aa5fb82):
110
- - fix: add some missing variables
120
+ - fix: add some missing variables
111
121
 
112
122
  - fix(tailwind): add individual color theme files for all color variants - [see commit e8d58bd](https://github.com/db-ux-design-system/core-web/commit/e8d58bde01039a3d233105c2c72efa71c619c4b4):
113
- - Create separate CSS files for each color
114
- - Move colors.css to colors/ subdirectory with adaptive theme
115
- - Add colors/index.css that imports all color variants
116
- - Update theme/index.css to import from colors/index.css
117
- - burgundy
118
- - critical
119
- - cyan
120
- - green
121
- - informational
122
- - light-green
123
- - neutral
124
- - orange
125
- - pink
126
- - red
127
- - successful
128
- - turquoise
129
- - violet
130
- - warning
131
- - yellow
123
+ - Create separate CSS files for each color
124
+ - Move colors.css to colors/ subdirectory with adaptive theme
125
+ - Add colors/index.css that imports all color variants
126
+ - Update theme/index.css to import from colors/index.css
127
+ - burgundy
128
+ - critical
129
+ - cyan
130
+ - green
131
+ - informational
132
+ - light-green
133
+ - neutral
134
+ - orange
135
+ - pink
136
+ - red
137
+ - successful
138
+ - turquoise
139
+ - violet
140
+ - warning
141
+ - yellow
132
142
 
133
143
  ## 4.0.1
134
144
 
@@ -155,7 +165,7 @@ _version bump_
155
165
  ### Patch Changes
156
166
 
157
167
  - enabled [`@db-ux/agent-cli`](https://www.npmjs.com/package/@db-ux/agent-cli) for every package - [see commit 0233048](https://github.com/db-ux-design-system/core-web/commit/023304869e61f5a506dca66a22d69e5f3d70f4d0):
158
- - auto-generate/auto-update `.github/copilot-instructions.md`, to ensure GitHub Copilot uses DB UX Components for code generation
168
+ - auto-generate/auto-update `.github/copilot-instructions.md`, to ensure GitHub Copilot uses DB UX Components for code generation
159
169
 
160
170
  ## 3.1.17
161
171
 
package/README.md CHANGED
@@ -38,11 +38,11 @@ npm i @db-ux/core-foundations
38
38
 
39
39
  You use this library if you need some colors, spacings etc.
40
40
 
41
- > **tl;dr:** Use the default theme and the bundled styles by importing [relative|absolute|rollup|webpack].css`.
41
+ > **tl;dr:** Use the default theme and the bundled styles by importing `bundle.css` and `theme/[relative|absolute|rollup|webpack].css`.
42
42
 
43
43
  ---
44
44
 
45
- First of all you need to import a theme which contains all tokens (css-properties). We provide a `default-theme.css` which handles dark/light mode as well.
45
+ First of all you need to import a theme which contains all tokens (css-properties). We provide a `theme/[relative|absolute|rollup|webpack].css` which handles dark/light mode as well.
46
46
 
47
47
  Afterward, you may import helper classes / placeholders to easily consume the tokens from your theme. There are some categories:
48
48
 
@@ -53,7 +53,7 @@ Afterward, you may import helper classes / placeholders to easily consume the to
53
53
  - **density**: Overwrite default density to scale adaptive components inside container using density
54
54
  - **colors**: Sets an adaptive color to a container, which passes all required css-properties to children
55
55
 
56
- You can import the complete **init** styles with `[relative|absolute|rollup|webpack].css` which apply the default:
56
+ The `bundle.css` applies those default:
57
57
 
58
58
  - [Density](https://marketingportal.extranet.deutschebahn.com/marketingportal/Design-Anwendungen/db-ux-design-system/version-3/principles/adaptive#:~:text=und%20Textfarben%20sicherstellt.-,Sizing,-Adaptive%20Sizing%20ist): `regular`
59
59
  - [Adaptive Coloring](https://marketingportal.extranet.deutschebahn.com/marketingportal/Design-Anwendungen/db-ux-design-system/version-3/principles/adaptive#:~:text=Akzeptieren-,Coloring,-Adaptive%20Coloring%20bezieht): `neutral-bg-lvl-1`
@@ -64,39 +64,28 @@ Default assets path for `relative.css` is `../assets`. Make sure to copy all use
64
64
 
65
65
  #### Import
66
66
 
67
- Import the styles in your main `.js | .ts` file or in your main `.css` file.
68
-
69
- CSS:
67
+ Import the styles in your main `.css` file.
70
68
 
71
69
  ```css
72
70
  /* index.css */
73
- @import "@db-ux/core-foundations/build/styles/relative.css";
74
-
75
- /* Optional: Use [data-divider] & [data-focus] everywhere */
76
- @import "@db-ux/core-foundations/build/styles/helpers/classes/all.css";
77
- /* Optional: Use [data-density] everywhere */
78
- @import "@db-ux/core-foundations/build/styles/density/classes/all.css";
79
- /* Optional: Use [data-font-size] everywhere */
80
- @import "@db-ux/core-foundations/build/styles/fonts/classes/all.css";
81
- /* Optional: Use [data-color] everywhere */
82
- @import "@db-ux/core-foundations/build/styles/colors/classes/all.css";
83
- ```
71
+ @layer whitelabel-theme, db-ux;
84
72
 
85
- JS/TS:
73
+ @import "@db-ux/core-foundations/build/styles/theme/relative.css" layer(theme);
86
74
 
87
- ```ts
88
- // main.[js|ts]
89
- /* index.css */
90
- import "@db-ux/core-foundations/build/styles/relative.css";
75
+ @import "@db-ux/core-foundations/build/styles/bundle.css" layer(db-ux);
91
76
 
92
77
  /* Optional: Use [data-divider] & [data-focus] everywhere */
93
- import "@db-ux/core-foundations/build/styles/helpers/classes/all.css";
78
+ @import "@db-ux/core-foundations/build/styles/helpers/classes/all.css"
79
+ layer(db-ux);
94
80
  /* Optional: Use [data-density] everywhere */
95
- import "@db-ux/core-foundations/build/styles/density/classes/all.css";
81
+ @import "@db-ux/core-foundations/build/styles/density/classes/all.css"
82
+ layer(db-ux);
96
83
  /* Optional: Use [data-font-size] everywhere */
97
- import "@db-ux/core-foundations/build/styles/fonts/classes/all.css";
84
+ @import "@db-ux/core-foundations/build/styles/fonts/classes/all.css"
85
+ layer(db-ux);
98
86
  /* Optional: Use [data-color] everywhere */
99
- import "@db-ux/core-foundations/build/styles/colors/classes/all.css";
87
+ @import "@db-ux/core-foundations/build/styles/colors/classes/all.css"
88
+ layer(db-ux);
100
89
  ```
101
90
 
102
91
  #### Use
@@ -130,46 +119,6 @@ In HTML:
130
119
 
131
120
  ### SCSS
132
121
 
133
- Default assets path for `relative.scss` is `../assets`. Make sure to copy all used resources like icons and fonts into your `public` folder before build. **Or** you use a modern bundler which handles bundling for you. In this case use `[rollup|webpack].scss`.
134
-
135
- #### Import
136
-
137
- Import the styles in your main `.js | .ts` file or in your main `.scss` file.
138
-
139
- SCSS:
140
-
141
- ```scss
142
- /* index.css */
143
- @forward "@db-ux/core-foundations/build/styles/relative";
144
-
145
- /* Optional: Use [data-divider] & [data-focus] everywhere */
146
- @forward "@db-ux/core-foundations/build/styles/helpers/classes/all";
147
- /* Optional: Use [data-density] everywhere */
148
- @forward "@db-ux/core-foundations/build/styles/density/classes/all";
149
- /* Optional: Use [data-font-size] everywhere */
150
- @forward "@db-ux/core-foundations/build/styles/fonts/classes/all";
151
- /* Optional: Use [data-color] everywhere */
152
- @forward "@db-ux/core-foundations/build/styles/colors/classes/all";
153
- ```
154
-
155
- > **Note:** Besides of forwarding the classes you can use placeholders to include only some specific styles.
156
-
157
- JS/TS:
158
-
159
- ```ts
160
- // main.[js|ts]
161
- import "@db-ux/core-foundations/build/styles/relative.scss";
162
-
163
- /* Optional: Use [data-divider] & [data-focus] everywhere */
164
- import "@db-ux/core-foundations/build/styles/helpers/classes/all.scss";
165
- /* Optional: Use [data-density] everywhere */
166
- import "@db-ux/core-foundations/build/styles/density/classes/all.scss";
167
- /* Optional: Use [data-font-size] everywhere */
168
- import "@db-ux/core-foundations/build/styles/fonts/classes/all.scss";
169
- /* Optional: Use [data-color] everywhere */
170
- import "@db-ux/core-foundations/build/styles/colors/classes/all.scss";
171
- ```
172
-
173
122
  #### Use
174
123
 
175
124
  In SCSS:
@@ -313,13 +262,11 @@ If you want to optimize the size of the loaded styles, you might want to skip lo
313
262
 
314
263
  ```css
315
264
  /* The theme contains all prop required for components like spacings, colors, etc. You can replace it with your own theme. */
316
- @import "@db-ux/core-foundations/build/styles/defaults/default-theme.css";
265
+ @import "@db-ux/core-foundations/build/styles/theme/relative.css";
317
266
  /* The font include uses default font families based on your bundling paths (relative, absolute, webpack, rollup). You can replace it with your own fonts. */
318
267
  @import "@db-ux/core-foundations/build/styles/fonts/relative.css";
319
268
  /* The icon include uses default icons based on your bundling paths (relative, absolute, webpack, rollup). You can replace it with your own icons. */
320
269
  @import "@db-ux/core-foundations/build/styles/icons/relative.css";
321
- /* The index file will add some additional styles to normalize html defaults and add some default settings like default density, etc. */
322
- @import "@db-ux/core-foundations/build/styles/index.css";
323
270
  ```
324
271
 
325
272
  #### Optimize index
@@ -40,6 +40,41 @@
40
40
  - font: `text-body-sm`
41
41
  - Always stick to the variables. Don't use values like `p-4` or `m-[16px]`; use `p-fix-xs` or `m-fix-md` instead.
42
42
 
43
+ ### Import
44
+
45
+ #### Tailwind v4
46
+
47
+ ```css
48
+ @import "tailwindcss";
49
+ @import "@db-ux/core-foundations/build/tailwind/theme/index.css";
50
+ ```
51
+
52
+ #### Tailwind v3
53
+
54
+ > **Note:** In Tailwind v4 you can use the config with `@config "tailwind.config.[js|ts]";` inside your `.css` file as well.
55
+
56
+ After this you can extend your tailwind config like this:
57
+
58
+ ```javascript
59
+ //tailwind.config.js
60
+ /** @type {import('tailwindcss').Config} */
61
+ import tokens from "@db-ux/core-foundations/build/tailwind/tailwind-tokens.json";
62
+
63
+ export default {
64
+ content: ["./index.html", "./src/**/*.{js,jsx,ts,tsx}"],
65
+ plugins: [],
66
+ theme: {
67
+ ...tokens,
68
+ gap: ({ theme }) => ({
69
+ ...theme("spacing")
70
+ }),
71
+ space: ({ theme }) => ({
72
+ ...theme("spacing")
73
+ })
74
+ }
75
+ };
76
+ ```
77
+
43
78
  ## Figma MCP
44
79
 
45
80
  - If you use Figma MCP always generate code with project's conventions, such as using @db-ux/core-components and @db-ux/core-foundations.
@@ -1,3 +1,5 @@
1
+ ## Usage
2
+
1
3
  ```html
2
4
  <div class="flex flex-col gap-md">
3
5
  <div class="grid grid-cols-2 md:grid-cols-3 gap-xs">
@@ -125,12 +127,12 @@
125
127
 
126
128
  ### Gap
127
129
 
128
- - `gap-3xs`
129
- - `gap-2xs`
130
- - `gap-xs`
131
- - `gap-sm`
132
- - `gap-md`
133
- - `gap-lg`
134
- - `gap-xl`
135
- - `gap-2xl`
136
- - `gap-3xl`
130
+ - `gap-fix-3xs`
131
+ - `gap-fix-2xs`
132
+ - `gap-fix-xs`
133
+ - `gap-fix-sm`
134
+ - `gap-fix-md`
135
+ - `gap-fix-lg`
136
+ - `gap-fix-xl`
137
+ - `gap-fix-2xl`
138
+ - `gap-fix-3xl`