@db-ux/core-foundations 4.5.4-postcss-a42fe67 → 4.5.4-postcss2-6de35db

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 (37) hide show
  1. package/README.md +16 -69
  2. package/agent/_instructions.md +35 -0
  3. package/agent/tailwind/Variables.md +11 -9
  4. package/build/styles/{index.css → bundle.css} +59 -4
  5. package/build/styles/{index.scss → bundle.scss} +5 -0
  6. package/build/styles/fonts/absolute.scss +1 -1
  7. package/build/styles/fonts/relative.scss +1 -1
  8. package/build/styles/fonts/rollup.scss +1 -1
  9. package/build/styles/fonts/webpack.scss +1 -1
  10. package/build/styles/icons/absolute.scss +1 -1
  11. package/build/styles/icons/relative.scss +1 -1
  12. package/build/styles/icons/rollup.scss +1 -1
  13. package/build/styles/icons/webpack.scss +1 -1
  14. package/build/styles/theme/absolute.css +1 -0
  15. package/build/styles/theme/relative.css +1 -0
  16. package/build/styles/{defaults/default-theme.scss → theme/relative.scss} +3 -6
  17. package/build/styles/theme/rollup.css +1 -0
  18. package/build/styles/theme/webpack.css +1 -0
  19. package/build/tailwind/theme/colors.css +1 -2919
  20. package/build/tailwind/theme/colors.scss +1 -10
  21. package/build/tailwind/theme/dimensions.css +77 -160
  22. package/package.json +4 -4
  23. package/build/styles/absolute.css +0 -10635
  24. package/build/styles/defaults/default-theme.css +0 -97
  25. package/build/styles/relative.css +0 -10635
  26. package/build/styles/relative.scss +0 -4
  27. package/build/styles/rollup.css +0 -10635
  28. package/build/styles/webpack.css +0 -10635
  29. package/build/tailwind/theme/_variables.scss +0 -77
  30. package/build/tailwind/theme/dimensions.scss +0 -17
  31. /package/build/styles/{_absolute.assets-paths.scss → theme/_absolute.assets-paths.scss} +0 -0
  32. /package/build/styles/{_default.assets-paths.scss → theme/_default.assets-paths.scss} +0 -0
  33. /package/build/styles/{_rollup.assets-paths.scss → theme/_rollup.assets-paths.scss} +0 -0
  34. /package/build/styles/{_webpack.assets-paths.scss → theme/_webpack.assets-paths.scss} +0 -0
  35. /package/build/styles/{absolute.scss → theme/absolute.scss} +0 -0
  36. /package/build/styles/{rollup.scss → theme/rollup.scss} +0 -0
  37. /package/build/styles/{webpack.scss → theme/webpack.scss} +0 -0
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`
@@ -1,12 +1,12 @@
1
1
  @charset "UTF-8";
2
2
  /* Use this file if you want the default color and density in your project */
3
3
  /* Variants for adaptive components like input, select, notification, ... */
4
- blockquote:not([class]), :root,
4
+ blockquote:not([class]), [data-mode], :root,
5
5
  :host {
6
6
  /* stylelint-disable-next-line at-rule-prelude-no-invalid,layer-name-pattern */
7
7
  }
8
8
  @layer variables {
9
- blockquote:not([class]), :root,
9
+ blockquote:not([class]), [data-mode], :root,
10
10
  :host {
11
11
  --db-adaptive-bg-basic-level-1-default: var(
12
12
  --db-neutral-bg-basic-level-1-default
@@ -158,12 +158,12 @@ blockquote:not([class]), :root,
158
158
  }
159
159
  }
160
160
 
161
- :root,
161
+ [data-mode], :root,
162
162
  :host {
163
163
  background-color: var(--db-neutral-bg-basic-level-1-default);
164
164
  color: var(--db-neutral-on-bg-basic-emphasis-100-default);
165
165
  }
166
- :root::before, :root::after {
166
+ [data-mode]::before, :root::before, [data-mode]::after, :root::after {
167
167
  --db-icon-color: var(--db-neutral-on-bg-basic-emphasis-100-default);
168
168
  }
169
169
 
@@ -4905,3 +4905,58 @@ details > ::before,
4905
4905
  details > ::after {
4906
4906
  box-sizing: var(--db-box-sizing, border-box);
4907
4907
  }
4908
+
4909
+ /* 224px */
4910
+ @property --db-container-3xs {
4911
+ syntax: "*";
4912
+ initial-value: 14rem;
4913
+ inherits: true;
4914
+ }
4915
+ /* 256px */
4916
+ @property --db-container-2xs {
4917
+ syntax: "*";
4918
+ initial-value: 16rem;
4919
+ inherits: true;
4920
+ }
4921
+ /* 320px */
4922
+ @property --db-container-xs {
4923
+ syntax: "*";
4924
+ initial-value: 20rem;
4925
+ inherits: true;
4926
+ }
4927
+ /* 384px */
4928
+ @property --db-container-sm {
4929
+ syntax: "*";
4930
+ initial-value: 24rem;
4931
+ inherits: true;
4932
+ }
4933
+ /* 448px */
4934
+ @property --db-container-md {
4935
+ syntax: "*";
4936
+ initial-value: 28rem;
4937
+ inherits: true;
4938
+ }
4939
+ /* 512px */
4940
+ @property --db-container-lg {
4941
+ syntax: "*";
4942
+ initial-value: 32rem;
4943
+ inherits: true;
4944
+ }
4945
+ /* 576px */
4946
+ @property --db-container-xl {
4947
+ syntax: "*";
4948
+ initial-value: 36rem;
4949
+ inherits: true;
4950
+ }
4951
+ /* 672px */
4952
+ @property --db-container-2xl {
4953
+ syntax: "*";
4954
+ initial-value: 42rem;
4955
+ inherits: true;
4956
+ }
4957
+ /* 768px */
4958
+ @property --db-container-3xl {
4959
+ syntax: "*";
4960
+ initial-value: 48rem;
4961
+ inherits: true;
4962
+ }
@@ -4,3 +4,8 @@
4
4
  @forward "defaults/default-code";
5
5
  @forward "defaults/default-icons";
6
6
  @forward "defaults/default-required";
7
+ @forward "defaults/default-container-properties";
8
+
9
+ [data-mode] {
10
+ @extend %db-neutral-bg-basic-level-1;
11
+ }
@@ -1,2 +1,2 @@
1
- @use "../absolute.assets-paths";
1
+ @use "../theme/absolute.assets-paths";
2
2
  @forward "./relative";
@@ -1,4 +1,4 @@
1
- @use "../default.assets-paths" as assets-paths;
1
+ @use "../theme/default.assets-paths" as assets-paths;
2
2
 
3
3
  @font-face {
4
4
  font-family: OpenSans;
@@ -1,2 +1,2 @@
1
- @use "../rollup.assets-paths";
1
+ @use "../theme/rollup.assets-paths";
2
2
  @forward "./relative";
@@ -1,2 +1,2 @@
1
- @use "../webpack.assets-paths";
1
+ @use "../theme/webpack.assets-paths";
2
2
  @forward "./relative";
@@ -1,2 +1,2 @@
1
- @use "../absolute.assets-paths";
1
+ @use "../theme/absolute.assets-paths";
2
2
  @forward "./relative";
@@ -1,5 +1,5 @@
1
1
  @use "index";
2
- @use "../default.assets-paths" as assets-paths;
2
+ @use "../theme/default.assets-paths" as assets-paths;
3
3
 
4
4
  @each $variant in index.$default-icon-variants {
5
5
  @font-face {
@@ -1,2 +1,2 @@
1
- @use "../rollup.assets-paths";
1
+ @use "../theme/rollup.assets-paths";
2
2
  @forward "./relative";
@@ -1,2 +1,2 @@
1
- @use "../webpack.assets-paths";
1
+ @use "../theme/webpack.assets-paths";
2
2
  @forward "./relative";