opui-css 4.1.0 → 5.0.1

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 (114) hide show
  1. package/CHANGELOG.md +282 -247
  2. package/LICENSE +21 -21
  3. package/MIGRATING.md +127 -105
  4. package/README.md +87 -87
  5. package/astro/index.ts +46 -46
  6. package/components/AGENTS.md +248 -247
  7. package/components/Accordion/Accordion.astro +42 -42
  8. package/components/Anchor/Anchor.astro +51 -51
  9. package/components/Avatar/Avatar.astro +38 -44
  10. package/components/Badge/Badge.astro +59 -54
  11. package/components/Button/Button.astro +45 -45
  12. package/components/ButtonGroup/ButtonGroup.astro +29 -29
  13. package/components/Callout/Callout.astro +75 -75
  14. package/components/Card/Card.astro +36 -36
  15. package/components/Checkbox/Checkbox.astro +76 -76
  16. package/components/Checkbox/CheckboxInput.astro +32 -32
  17. package/components/Chip/Chip.astro +37 -37
  18. package/components/ClassicSelect/ClassicSelect.astro +83 -83
  19. package/components/DescriptionList/Description.astro +12 -12
  20. package/components/DescriptionList/DescriptionList.astro +22 -22
  21. package/components/DescriptionList/Item.astro +12 -12
  22. package/components/DescriptionList/Term.astro +12 -12
  23. package/components/DescriptionList/index.ts +12 -12
  24. package/components/Dialog/Dialog.astro +41 -41
  25. package/components/Divider/Divider.astro +17 -14
  26. package/components/Drawer/Drawer.astro +49 -49
  27. package/components/Drawer/DrawerFooter.astro +14 -14
  28. package/components/Drawer/DrawerHeader.astro +31 -31
  29. package/components/FieldDescription/FieldDescription.astro +13 -13
  30. package/components/FieldGroup/FieldGroup.astro +31 -31
  31. package/components/FieldLegend/FieldLegend.astro +15 -15
  32. package/components/FieldSet/FieldSet.astro +15 -15
  33. package/components/Form/Form.astro +15 -15
  34. package/components/IconButton/IconButton.astro +26 -26
  35. package/components/List/List.astro +36 -36
  36. package/components/ListItem/ListItem.astro +118 -118
  37. package/components/Progress/Progress.astro +41 -40
  38. package/components/Radio/Radio.astro +70 -70
  39. package/components/Radio/RadioInput.astro +24 -24
  40. package/components/Range/Range.astro +136 -136
  41. package/components/Select/Select.astro +106 -106
  42. package/components/Switch/Switch.astro +101 -101
  43. package/components/Switch/SwitchInput.astro +25 -25
  44. package/components/Table/Body.astro +13 -13
  45. package/components/Table/Cell.astro +13 -13
  46. package/components/Table/Column.astro +15 -15
  47. package/components/Table/ColumnGroup.astro +13 -13
  48. package/components/Table/Head.astro +13 -13
  49. package/components/Table/HeaderCell.astro +13 -13
  50. package/components/Table/Row.astro +13 -13
  51. package/components/Table/Table.astro +18 -15
  52. package/components/Table/index.ts +20 -20
  53. package/components/Tabs/Tabs.astro +28 -28
  54. package/components/Tabs/TabsItem.astro +47 -47
  55. package/components/Tabs/TabsPanel.astro +21 -21
  56. package/components/Tabs/TabsTab.astro +19 -19
  57. package/components/Tabs/index.ts +14 -14
  58. package/components/TextField/TextField.astro +128 -128
  59. package/components/Textarea/Textarea.astro +106 -106
  60. package/components/Toast/Toast.astro +42 -42
  61. package/components/ToggleButton/ToggleButton.astro +53 -53
  62. package/components/ToggleGroup/ToggleGroup.astro +49 -49
  63. package/components/Tooltip/Tooltip.astro +30 -30
  64. package/core/normalize.css +194 -194
  65. package/core/palette.css +59 -59
  66. package/core/utils.css +71 -71
  67. package/css/components/accordion.css +174 -174
  68. package/css/components/anchor.css +27 -27
  69. package/css/components/avatar.css +65 -65
  70. package/css/components/badge.css +107 -107
  71. package/css/components/button-group.css +179 -179
  72. package/css/components/button.css +215 -215
  73. package/css/components/callout.css +109 -109
  74. package/css/components/card.css +117 -117
  75. package/css/components/checkbox.css +205 -205
  76. package/css/components/chip.css +87 -87
  77. package/css/components/description-list.css +80 -77
  78. package/css/components/dialog.css +68 -68
  79. package/css/components/divider.css +20 -20
  80. package/css/components/drawer.css +171 -171
  81. package/css/components/form.css +146 -146
  82. package/css/components/icon-button.css +139 -139
  83. package/css/components/link.css +21 -21
  84. package/css/components/list.css +345 -345
  85. package/css/components/progress.css +102 -97
  86. package/css/components/radio.css +172 -172
  87. package/css/components/range.css +337 -337
  88. package/css/components/select.css +169 -169
  89. package/css/components/spinner.css +37 -37
  90. package/css/components/switch.css +268 -268
  91. package/css/components/table.css +179 -179
  92. package/css/components/tabs.css +83 -77
  93. package/css/components/text-field.css +450 -450
  94. package/css/components/text-input.css +64 -64
  95. package/css/components/textarea.css +24 -24
  96. package/css/components/toast.css +161 -161
  97. package/css/components/toggle-button.css +87 -87
  98. package/css/components/toggle-group.css +56 -56
  99. package/css/components/tooltip.css +67 -67
  100. package/css/components/typography.css +585 -585
  101. package/css/components.css +41 -41
  102. package/css/imports.css +16 -16
  103. package/css/js/checkbox.js +21 -21
  104. package/css/js/toast.js +94 -94
  105. package/css/theme.css +132 -132
  106. package/dist/op.css +65 -65
  107. package/dist/op.css.map +1 -1
  108. package/dist/opui.components.css +5159 -5145
  109. package/dist/opui.components.css.map +1 -1
  110. package/dist/opui.css +5668 -5654
  111. package/dist/opui.css.map +1 -1
  112. package/env.d.ts +14 -14
  113. package/open-props.css +9 -9
  114. package/package.json +81 -81
@@ -1,215 +1,215 @@
1
- @layer components.root {
2
- :where(.button) {
3
- --_color: light-dark(var(--color-16), var(--color-1));
4
- --_color-contrast: light-dark(var(--color-1), var(--color-16));
5
- --_color-tonal: var(--surface-tonal);
6
-
7
- --_accent: var(--_color);
8
- --_accent-contrast: var(--_color-contrast);
9
- --_accent-tonal: var(--_color-tonal);
10
- --_accent-tonal-contrast: var(--_color);
11
-
12
- --_default-hover-bg-color: light-dark(oklch(from var(--_accent) l 0.01 h / 10%),
13
- oklch(from var(--_accent) l 0.01 h / 20%));
14
- --_default-active-bg-color: light-dark(oklch(from var(--_accent) l 0.06 h / 20%),
15
- oklch(from var(--_accent) l 0.06 h / 30%));
16
-
17
- --_filled-hover-bg-color: light-dark(oklch(from var(--_accent) calc(l + 0.2) c h),
18
- oklch(from var(--_accent) calc(l - 0.1) c h));
19
- --_filled-active-bg-color: light-dark(oklch(from var(--_accent) calc(l + 0.3) c h),
20
- oklch(from var(--_accent) calc(l - 0.15) c h));
21
- --_outlined-active-bg-color: var(--_filled-active-bg-color);
22
-
23
- --_bg-color: transparent;
24
- --_border-color: transparent;
25
- --_border-width: var(--border-size-1);
26
- --_font-size: var(--font-size-1);
27
- --_min-height: var(--button-size);
28
- --_border-radius: var(--button-border-radius, var(--radius-2));
29
- --_text-color: var(--_accent);
30
-
31
- -webkit-tap-highlight-color: transparent;
32
- -webkit-touch-callout: none;
33
- align-items: center;
34
- background-color: var(--_bg-color);
35
- border: var(--_border-width) solid var(--_border-color);
36
- border-radius: var(--_border-radius);
37
- color: var(--_text-color);
38
- display: inline-flex;
39
- font-size: var(--_font-size);
40
- font-weight: 700;
41
- gap: var(--size-2);
42
- justify-content: center;
43
- min-block-size: var(--_min-height);
44
- padding-block: 0.5ex;
45
- padding-inline: 1.5ex;
46
- text-align: center;
47
- text-decoration: none;
48
- transition: background-color .1s ease, color .1s ease,
49
- border-color .1s ease, box-shadow .1s ease;
50
- user-select: none;
51
-
52
- /* Colors — shared interaction model for critical and primary.
53
- Each color modifier below only swaps --_color; the tonal surface,
54
- contrast text, and hover/active strategy are identical.
55
- The .critical scope class in theme.css redirects --palette-source so
56
- --color-6 below becomes a tint of the active color. */
57
- &.critical,
58
- &.primary {
59
- --_color-contrast: var(--gray-1);
60
- --_color-tonal: var(--color-6);
61
- --_accent-tonal-contrast: var(--text-primary-contrast);
62
-
63
- --_default-hover-bg-color: oklch(from var(--_accent) l c h / 15%);
64
- --_default-active-bg-color: oklch(from var(--_accent) l c h / 25%);
65
-
66
- --_filled-hover-bg-color: oklch(from var(--_accent) calc(l - 0.1) c h);
67
- --_filled-active-bg-color: oklch(from var(--_accent) calc(l - 0.15) c h);
68
-
69
- --_outlined-active-bg-color: oklch(from var(--_accent) calc(l - 0.1) c h);
70
- }
71
-
72
- &.critical {
73
- --_color: var(--critical);
74
- }
75
-
76
- &.primary {
77
- --_color: var(--primary);
78
- }
79
-
80
- /* Disabled */
81
- &:where([disabled]) {
82
- --_text-color: color-mix(in oklch,
83
- var(--text-muted) 50%,
84
- var(--surface-default));
85
-
86
- cursor: not-allowed;
87
- opacity: 0.64;
88
- }
89
-
90
- /* Hover & Active */
91
- &:where(:not([disabled])) {
92
- &:where(:not(:active):hover) {
93
- --_bg-color: var(--_default-hover-bg-color);
94
- }
95
-
96
- &:where(:hover:active),
97
- &[aria-current="page"] {
98
- --_bg-color: var(--_default-active-bg-color);
99
- }
100
- }
101
-
102
-
103
- /* Icons / Keyboard */
104
- &:where(:has(svg), &.icon-only) {
105
- gap: 1ex;
106
-
107
- svg {
108
- color: currentColor;
109
- max-block-size: 0.7lh;
110
- }
111
- }
112
-
113
- /* Keyboard input */
114
- :is(kbd) {
115
- background-color: oklch(from currentColor l c h / 10%);
116
- border: 0;
117
- color: oklch(from currentColor l c h / 80%);
118
- font-size: 0.8em;
119
- font-weight: 400;
120
- line-height: 1.2;
121
- }
122
-
123
- /* Sizes — heights aliased from the shared --control-size scale.
124
- Override --button-size-* in a parent scope to resize an entire region. */
125
- &.x-small {
126
- --_min-height: var(--button-size-x-small);
127
- --_font-size: var(--font-size-0);
128
- padding-block: 0;
129
- padding-inline: .5ex;
130
- }
131
-
132
- &.small {
133
- --_min-height: var(--button-size-small);
134
- --_font-size: var(--font-size-05);
135
- padding-block: 0;
136
- padding-inline: .75ex;
137
- }
138
-
139
- &.large {
140
- --_min-height: var(--button-size-large);
141
- padding-inline: 4ex;
142
- }
143
-
144
- /* Variants */
145
- &.outlined {
146
- --_bg-color: transparent;
147
- --_border-color: var(--_accent);
148
- --_text-color: var(--_accent);
149
-
150
- &:where(:not([disabled])) {
151
- &:where(:not(:active):hover) {
152
- --_bg-color: var(--_accent);
153
- --_border-color: var(--_accent);
154
- --_text-color: var(--_accent-contrast);
155
- }
156
-
157
- &:where(:active) {
158
- --_bg-color: var(--_outlined-active-bg-color);
159
- --_border-color: var(--_outlined-active-bg-color);
160
- --_text-color: var(--_accent-contrast);
161
- }
162
- }
163
- }
164
-
165
- &.tonal {
166
- --_bg-color: var(--_accent-tonal);
167
- --_text-color: var(--_accent-tonal-contrast);
168
-
169
- &:where(:not([disabled])) {
170
- &:where(:not(:active):hover) {
171
- --_bg-color: var(--_accent);
172
- --_text-color: var(--_accent-contrast);
173
- }
174
-
175
- &:where(:active) {
176
- --_bg-color: var(--_outlined-active-bg-color);
177
- --_text-color: var(--_accent-contrast);
178
- }
179
- }
180
- }
181
-
182
- &.filled {
183
- --_bg-color: var(--_accent);
184
- --_text-color: var(--_accent-contrast);
185
-
186
- &:where(:not([disabled])) {
187
- &:where(:not(:active):hover) {
188
- --_bg-color: var(--_filled-hover-bg-color);
189
- }
190
-
191
- &:where(:active) {
192
- --_bg-color: var(--_filled-active-bg-color);
193
- }
194
- }
195
- }
196
- }
197
-
198
- /* file input */
199
- :where(input[type="file"]) {
200
- align-self: flex-start;
201
- border: var(--border-size-1) solid var(--surface-filled);
202
- border-radius: var(--radius-2);
203
- box-shadow: var(--inner-shadow-4);
204
- color: var(--text-muted-contrast);
205
- cursor: initial;
206
- max-inline-size: 100%;
207
- padding: 0;
208
- }
209
-
210
- :where(input[type="file"])::-webkit-file-upload-button,
211
- :where(input[type="file"])::file-selector-button {
212
- cursor: pointer;
213
- margin-inline-end: var(--size-relative-6);
214
- }
215
- }
1
+ @layer components.root {
2
+ :where(.ui-button) {
3
+ --_color: light-dark(var(--color-16), var(--color-1));
4
+ --_color-contrast: light-dark(var(--color-1), var(--color-16));
5
+ --_color-tonal: var(--surface-tonal);
6
+
7
+ --_accent: var(--_color);
8
+ --_accent-contrast: var(--_color-contrast);
9
+ --_accent-tonal: var(--_color-tonal);
10
+ --_accent-tonal-contrast: var(--_color);
11
+
12
+ --_default-hover-bg-color: light-dark(oklch(from var(--_accent) l 0.01 h / 10%),
13
+ oklch(from var(--_accent) l 0.01 h / 20%));
14
+ --_default-active-bg-color: light-dark(oklch(from var(--_accent) l 0.06 h / 20%),
15
+ oklch(from var(--_accent) l 0.06 h / 30%));
16
+
17
+ --_filled-hover-bg-color: light-dark(oklch(from var(--_accent) calc(l + 0.2) c h),
18
+ oklch(from var(--_accent) calc(l - 0.1) c h));
19
+ --_filled-active-bg-color: light-dark(oklch(from var(--_accent) calc(l + 0.3) c h),
20
+ oklch(from var(--_accent) calc(l - 0.15) c h));
21
+ --_outlined-active-bg-color: var(--_filled-active-bg-color);
22
+
23
+ --_bg-color: transparent;
24
+ --_border-color: transparent;
25
+ --_border-width: var(--border-size-1);
26
+ --_font-size: var(--font-size-1);
27
+ --_min-height: var(--button-size);
28
+ --_border-radius: var(--button-border-radius, var(--radius-2));
29
+ --_text-color: var(--_accent);
30
+
31
+ -webkit-tap-highlight-color: transparent;
32
+ -webkit-touch-callout: none;
33
+ align-items: center;
34
+ background-color: var(--_bg-color);
35
+ border: var(--_border-width) solid var(--_border-color);
36
+ border-radius: var(--_border-radius);
37
+ color: var(--_text-color);
38
+ display: inline-flex;
39
+ font-size: var(--_font-size);
40
+ font-weight: 700;
41
+ gap: var(--size-2);
42
+ justify-content: center;
43
+ min-block-size: var(--_min-height);
44
+ padding-block: 0.5ex;
45
+ padding-inline: 1.5ex;
46
+ text-align: center;
47
+ text-decoration: none;
48
+ transition: background-color .1s ease, color .1s ease,
49
+ border-color .1s ease, box-shadow .1s ease;
50
+ user-select: none;
51
+
52
+ /* Colors — shared interaction model for critical and primary.
53
+ Each color modifier below only swaps --_color; the tonal surface,
54
+ contrast text, and hover/active strategy are identical.
55
+ The .critical scope class in theme.css redirects --palette-source so
56
+ --color-6 below becomes a tint of the active color. */
57
+ &.ui-critical,
58
+ &.ui-primary {
59
+ --_color-contrast: var(--gray-1);
60
+ --_color-tonal: var(--color-6);
61
+ --_accent-tonal-contrast: var(--text-primary-contrast);
62
+
63
+ --_default-hover-bg-color: oklch(from var(--_accent) l c h / 15%);
64
+ --_default-active-bg-color: oklch(from var(--_accent) l c h / 25%);
65
+
66
+ --_filled-hover-bg-color: oklch(from var(--_accent) calc(l - 0.1) c h);
67
+ --_filled-active-bg-color: oklch(from var(--_accent) calc(l - 0.15) c h);
68
+
69
+ --_outlined-active-bg-color: oklch(from var(--_accent) calc(l - 0.1) c h);
70
+ }
71
+
72
+ &.ui-critical {
73
+ --_color: var(--critical);
74
+ }
75
+
76
+ &.ui-primary {
77
+ --_color: var(--primary);
78
+ }
79
+
80
+ /* Disabled */
81
+ &:where([disabled]) {
82
+ --_text-color: color-mix(in oklch,
83
+ var(--text-muted) 50%,
84
+ var(--surface-default));
85
+
86
+ cursor: not-allowed;
87
+ opacity: 0.64;
88
+ }
89
+
90
+ /* Hover & Active */
91
+ &:where(:not([disabled])) {
92
+ &:where(:not(:active):hover) {
93
+ --_bg-color: var(--_default-hover-bg-color);
94
+ }
95
+
96
+ &:where(:hover:active),
97
+ &[aria-current="page"] {
98
+ --_bg-color: var(--_default-active-bg-color);
99
+ }
100
+ }
101
+
102
+
103
+ /* Icons / Keyboard */
104
+ &:where(:has(svg), &.ui-icon-only) {
105
+ gap: 1ex;
106
+
107
+ svg {
108
+ color: currentColor;
109
+ max-block-size: 0.7lh;
110
+ }
111
+ }
112
+
113
+ /* Keyboard input */
114
+ :is(kbd) {
115
+ background-color: oklch(from currentColor l c h / 10%);
116
+ border: 0;
117
+ color: oklch(from currentColor l c h / 80%);
118
+ font-size: 0.8em;
119
+ font-weight: 400;
120
+ line-height: 1.2;
121
+ }
122
+
123
+ /* Sizes — heights aliased from the shared --control-size scale.
124
+ Override --button-size-* in a parent scope to resize an entire region. */
125
+ &.ui-x-small {
126
+ --_min-height: var(--button-size-x-small);
127
+ --_font-size: var(--font-size-0);
128
+ padding-block: 0;
129
+ padding-inline: .5ex;
130
+ }
131
+
132
+ &.ui-small {
133
+ --_min-height: var(--button-size-small);
134
+ --_font-size: var(--font-size-05);
135
+ padding-block: 0;
136
+ padding-inline: .75ex;
137
+ }
138
+
139
+ &.ui-large {
140
+ --_min-height: var(--button-size-large);
141
+ padding-inline: 4ex;
142
+ }
143
+
144
+ /* Variants */
145
+ &.ui-outlined {
146
+ --_bg-color: transparent;
147
+ --_border-color: var(--_accent);
148
+ --_text-color: var(--_accent);
149
+
150
+ &:where(:not([disabled])) {
151
+ &:where(:not(:active):hover) {
152
+ --_bg-color: var(--_accent);
153
+ --_border-color: var(--_accent);
154
+ --_text-color: var(--_accent-contrast);
155
+ }
156
+
157
+ &:where(:active) {
158
+ --_bg-color: var(--_outlined-active-bg-color);
159
+ --_border-color: var(--_outlined-active-bg-color);
160
+ --_text-color: var(--_accent-contrast);
161
+ }
162
+ }
163
+ }
164
+
165
+ &.ui-tonal {
166
+ --_bg-color: var(--_accent-tonal);
167
+ --_text-color: var(--_accent-tonal-contrast);
168
+
169
+ &:where(:not([disabled])) {
170
+ &:where(:not(:active):hover) {
171
+ --_bg-color: var(--_accent);
172
+ --_text-color: var(--_accent-contrast);
173
+ }
174
+
175
+ &:where(:active) {
176
+ --_bg-color: var(--_outlined-active-bg-color);
177
+ --_text-color: var(--_accent-contrast);
178
+ }
179
+ }
180
+ }
181
+
182
+ &.ui-filled {
183
+ --_bg-color: var(--_accent);
184
+ --_text-color: var(--_accent-contrast);
185
+
186
+ &:where(:not([disabled])) {
187
+ &:where(:not(:active):hover) {
188
+ --_bg-color: var(--_filled-hover-bg-color);
189
+ }
190
+
191
+ &:where(:active) {
192
+ --_bg-color: var(--_filled-active-bg-color);
193
+ }
194
+ }
195
+ }
196
+ }
197
+
198
+ /* file input */
199
+ :where(input[type="file"]) {
200
+ align-self: flex-start;
201
+ border: var(--border-size-1) solid var(--surface-filled);
202
+ border-radius: var(--radius-2);
203
+ box-shadow: var(--inner-shadow-4);
204
+ color: var(--text-muted-contrast);
205
+ cursor: initial;
206
+ max-inline-size: 100%;
207
+ padding: 0;
208
+ }
209
+
210
+ :where(input[type="file"])::-webkit-file-upload-button,
211
+ :where(input[type="file"])::file-selector-button {
212
+ cursor: pointer;
213
+ margin-inline-end: var(--size-relative-6);
214
+ }
215
+ }
@@ -1,109 +1,109 @@
1
- @layer components.root {
2
- :where(.callout) {
3
- --_bg-color: var(--surface-tonal);
4
- --_border-color: var(--surface-tonal);
5
- --_color: var(--text-primary);
6
- --_icon-color: currentColor;
7
- --_link-hover-color: var(--primary);
8
- --_padding: var(--size-3);
9
- --_border-radius: var(--border-radius);
10
- --_gap: var(--size-3);
11
- --_content-gap: var(--size-2);
12
- --_font-size: var(--font-size-05);
13
- --_title-font-size: var(--font-size-1);
14
- --_icon-size: var(--size-4);
15
- --_surface-bg: var(--surface-default);
16
-
17
- --_outlined-bg-color: var(--surface-default);
18
- --_outlined-border-color: var(--border-color);
19
- --_outlined-color: var(--text-primary);
20
- --_outlined-icon-color: currentColor;
21
-
22
- background-color: var(--_bg-color, var(--_surface-bg));
23
- border: 1px solid var(--_border-color, var(--border-color));
24
- border-radius: var(--_border-radius);
25
- color: var(--_color);
26
- isolation: isolate;
27
- padding: var(--_padding);
28
- position: relative;
29
-
30
- &.critical,
31
- &.info,
32
- &.neutral,
33
- &.success,
34
- &.warning {
35
- --_bg-color: light-dark(oklch(from var(--color-2) l c h / 20%), oklch(from var(--color-6) l c h / 5%));
36
- --_border-color: light-dark(var(--color-5), var(--color-11));
37
- --_color: light-dark(var(--color-16), var(--color-1));
38
- --_icon-color: var(--color-9);
39
-
40
- --_outlined-bg-color: var(--surface-default);
41
- --_outlined-border-color: var(--color-9);
42
- --_outlined-color: light-dark(var(--color-15), var(--color-1));
43
- --_outlined-icon-color: var(--color-9);
44
- }
45
-
46
- &.outlined {
47
- --_bg-color: var(--_outlined-bg-color);
48
- --_border-color: var(--_outlined-border-color);
49
- --_color: var(--_outlined-color);
50
- --_icon-color: var(--_outlined-icon-color);
51
- }
52
-
53
- &::before {
54
- background-color: var(--_bg-color);
55
- border-radius: inherit;
56
- content: "";
57
- inset: 0;
58
- pointer-events: none;
59
- position: absolute;
60
- z-index: -1;
61
- }
62
-
63
- &>.content {
64
- display: grid;
65
- font-size: var(--_font-size);
66
- gap: var(--_content-gap);
67
-
68
- h1,
69
- h2,
70
- h3,
71
- h4,
72
- h5,
73
- h6 {
74
- color: inherit;
75
- font-size: var(--_title-font-size);
76
- font-weight: 600;
77
-
78
- * {
79
- font-size: inherit;
80
- }
81
- }
82
- }
83
-
84
- /* Links
85
- * Can't make sure contrast will be acceptable (yet) so we use the current text color instead.
86
- */
87
- &:not(.outlined) {
88
- a[href] {
89
- color: inherit;
90
-
91
- &:hover {
92
- color: var(--_link-hover-color);
93
- }
94
- }
95
- }
96
-
97
- /* Icon */
98
- &:has(svg) {
99
- display: grid;
100
- gap: var(--_gap);
101
- grid-template-columns: var(--_icon-size) 1fr;
102
-
103
- svg {
104
- margin-block-start: 0.15rem;
105
- stroke: var(--_icon-color);
106
- }
107
- }
108
- }
109
- }
1
+ @layer components.root {
2
+ :where(.ui-callout) {
3
+ --_bg-color: var(--surface-tonal);
4
+ --_border-color: var(--surface-tonal);
5
+ --_color: var(--text-primary);
6
+ --_icon-color: currentColor;
7
+ --_link-hover-color: var(--primary);
8
+ --_padding: var(--size-3);
9
+ --_border-radius: var(--border-radius);
10
+ --_gap: var(--size-3);
11
+ --_content-gap: var(--size-2);
12
+ --_font-size: var(--font-size-05);
13
+ --_title-font-size: var(--font-size-1);
14
+ --_icon-size: var(--size-4);
15
+ --_surface-bg: var(--surface-default);
16
+
17
+ --_outlined-bg-color: var(--surface-default);
18
+ --_outlined-border-color: var(--border-color);
19
+ --_outlined-color: var(--text-primary);
20
+ --_outlined-icon-color: currentColor;
21
+
22
+ background-color: var(--_bg-color, var(--_surface-bg));
23
+ border: 1px solid var(--_border-color, var(--border-color));
24
+ border-radius: var(--_border-radius);
25
+ color: var(--_color);
26
+ isolation: isolate;
27
+ padding: var(--_padding);
28
+ position: relative;
29
+
30
+ &.ui-critical,
31
+ &.ui-info,
32
+ &.ui-neutral,
33
+ &.ui-success,
34
+ &.ui-warning {
35
+ --_bg-color: light-dark(oklch(from var(--color-2) l c h / 20%), oklch(from var(--color-6) l c h / 5%));
36
+ --_border-color: light-dark(var(--color-5), var(--color-11));
37
+ --_color: light-dark(var(--color-16), var(--color-1));
38
+ --_icon-color: var(--color-9);
39
+
40
+ --_outlined-bg-color: var(--surface-default);
41
+ --_outlined-border-color: var(--color-9);
42
+ --_outlined-color: light-dark(var(--color-15), var(--color-1));
43
+ --_outlined-icon-color: var(--color-9);
44
+ }
45
+
46
+ &.ui-outlined {
47
+ --_bg-color: var(--_outlined-bg-color);
48
+ --_border-color: var(--_outlined-border-color);
49
+ --_color: var(--_outlined-color);
50
+ --_icon-color: var(--_outlined-icon-color);
51
+ }
52
+
53
+ &::before {
54
+ background-color: var(--_bg-color);
55
+ border-radius: inherit;
56
+ content: "";
57
+ inset: 0;
58
+ pointer-events: none;
59
+ position: absolute;
60
+ z-index: -1;
61
+ }
62
+
63
+ &>.ui-content {
64
+ display: grid;
65
+ font-size: var(--_font-size);
66
+ gap: var(--_content-gap);
67
+
68
+ h1,
69
+ h2,
70
+ h3,
71
+ h4,
72
+ h5,
73
+ h6 {
74
+ color: inherit;
75
+ font-size: var(--_title-font-size);
76
+ font-weight: 600;
77
+
78
+ * {
79
+ font-size: inherit;
80
+ }
81
+ }
82
+ }
83
+
84
+ /* Links
85
+ * Can't make sure contrast will be acceptable (yet) so we use the current text color instead.
86
+ */
87
+ &:not(.ui-outlined) {
88
+ a[href] {
89
+ color: inherit;
90
+
91
+ &:hover {
92
+ color: var(--_link-hover-color);
93
+ }
94
+ }
95
+ }
96
+
97
+ /* Icon */
98
+ &:has(svg) {
99
+ display: grid;
100
+ gap: var(--_gap);
101
+ grid-template-columns: var(--_icon-size) 1fr;
102
+
103
+ svg {
104
+ margin-block-start: 0.15rem;
105
+ stroke: var(--_icon-color);
106
+ }
107
+ }
108
+ }
109
+ }