css-tags 0.1.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 (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +875 -0
  3. package/carousel.js +86 -0
  4. package/components/accessibility.css +51 -0
  5. package/components/actions.css +76 -0
  6. package/components/alert.css +122 -0
  7. package/components/application-patterns.css +122 -0
  8. package/components/badge.css +125 -0
  9. package/components/box-extra.css +220 -0
  10. package/components/box.css +75 -0
  11. package/components/card.css +130 -0
  12. package/components/carousel.css +76 -0
  13. package/components/chip.css +71 -0
  14. package/components/container.css +55 -0
  15. package/components/content-patterns.css +234 -0
  16. package/components/disclosure.css +581 -0
  17. package/components/divider.css +68 -0
  18. package/components/flex.css +59 -0
  19. package/components/form-patterns.css +273 -0
  20. package/components/form.css +130 -0
  21. package/components/grid.css +82 -0
  22. package/components/identity.css +59 -0
  23. package/components/img-container.css +141 -0
  24. package/components/img-container.js +75 -0
  25. package/components/list.css +69 -0
  26. package/components/loading.css +112 -0
  27. package/components/masonry.css +48 -0
  28. package/components/modal.css +73 -0
  29. package/components/navigation-patterns.css +245 -0
  30. package/components/navigation.css +200 -0
  31. package/components/popover.css +49 -0
  32. package/components/site-shell.css +180 -0
  33. package/components/status.css +110 -0
  34. package/components/table.css +98 -0
  35. package/components/tabs.css +103 -0
  36. package/components/tooltip.css +87 -0
  37. package/components/tooltips.css +73 -0
  38. package/components/view-transition.css +73 -0
  39. package/core/base.css +62 -0
  40. package/core/defaults.css +490 -0
  41. package/core/engine.css +32 -0
  42. package/core/mixins.css +376 -0
  43. package/core/palette-accent.css +8 -0
  44. package/core/palette-base.css +107 -0
  45. package/core/palette-extended.css +142 -0
  46. package/core/palette-feedback.css +62 -0
  47. package/core/palette.css +7 -0
  48. package/core/reset.css +270 -0
  49. package/core/text.css +171 -0
  50. package/core/theme.css +608 -0
  51. package/core/tokens.css +488 -0
  52. package/core/typography.css +327 -0
  53. package/index.css +66 -0
  54. package/layouts/layout-extra.css +204 -0
  55. package/layouts/layout-extras-helpers.css +19 -0
  56. package/layouts/layout.css +348 -0
  57. package/package.json +66 -0
  58. package/theme-generator.css +979 -0
  59. package/themes/example-brand.css +59 -0
  60. package/themes/theme-packs.css +31 -0
  61. package/types/css-tags.d.ts +482 -0
  62. package/utilities/utilities.css +564 -0
  63. package/view-transition.js +111 -0
@@ -0,0 +1,220 @@
1
+ /**
2
+ * box-extra.css
3
+ *
4
+ * A supplementary library of mixins and utilities for the box model.
5
+ * ------------------------------------------------------------------------------
6
+ * This file provides the CSS-centric counterpart to the `<box>` component.
7
+ * It contains a powerful `@mixin --box` that allows you to apply the same
8
+ * declarative styling to any selector in your stylesheet.
9
+ *
10
+ * --- PHILOSOPHY ---
11
+ * - CSS-First: Apply box-model styling directly in your CSS where it belongs,
12
+ * without needing a specific HTML tag.
13
+ * - Reusability: Use the mixin to create consistent, custom components.
14
+ * - Convenience: Use the utility classes for common, one-off patterns.
15
+ *
16
+ * ==============================================================================
17
+ * ⚠️ IMPORTANT: PROPOSED FEATURE NOTICE ⚠️
18
+ * The @mixin rule is NOT SUPPORTED in any browser as of late 2025.
19
+ * This file demonstrates a forward-looking, pre-processor-free approach.
20
+ * ==============================================================================
21
+ *
22
+ * --- TABLE OF CONTENTS ---
23
+ *
24
+ * 1. CORE BOX MIXIN
25
+ * - `@mixin --box`
26
+ *
27
+ * 2. UTILITY CLASSES
28
+ * - `.u-panel`: A lightly styled container.
29
+ * - `.u-well`: An inset container.
30
+ * - `.u-spacer-block`: A vertical spacer.
31
+ *
32
+ */
33
+
34
+ /*
35
+ * ==============================================================================
36
+ * 1. CORE BOX MIXIN (Proposed Syntax)
37
+ * ==============================================================================
38
+ */
39
+
40
+ /**
41
+ * @mixin --box
42
+ * A comprehensive "Swiss Army Knife" mixin for applying common box-model and
43
+ * layout styles to any selector. It replicates the full functionality of the
44
+ * <box> component.
45
+ *
46
+ * -- SPACING PARAMETERS --
47
+ * @param {<length>} --p - Shorthand for block and inline padding.
48
+ * @param {<length>} --px - Overrides inline (horizontal) padding.
49
+ * @param {<length>} --py - Overrides block (vertical) padding.
50
+ * @param {<length>} --m - Shorthand for block and inline margin.
51
+ * @param {<length>} --mx - Overrides inline (horizontal) margin.
52
+ * @param {<length>} --my - Overrides block (vertical) margin.
53
+ *
54
+ * -- APPEARANCE PARAMETERS --
55
+ * @param {<color>} --bg - The background color.
56
+ * @param {<color>} --color - The text color.
57
+ * @param {string} --border - The full border property string.
58
+ * @param {<length>} --radius - The border-radius.
59
+ *
60
+ * -- LAYOUT & SIZING PARAMETERS --
61
+ * @param {string} --display - The display property (e.g., 'block', 'flex', 'grid').
62
+ * @param {<length>} --width, --height, --max-width - Sizing properties.
63
+ * @param {string} --align - The text-align property.
64
+ *
65
+ * @example
66
+ * .custom-alert {
67
+ * @apply --box(
68
+ * --display: flex,
69
+ * --p: var(--space-lg),
70
+ * --bg: var(--surface-error),
71
+ * --radius: var(--radius-md)
72
+ * );
73
+ * }
74
+ */
75
+ @mixin --box(
76
+ /* Spacing */
77
+ --p: 0,
78
+ --px: null,
79
+ --py: null,
80
+ --m: 0,
81
+ --mx: null,
82
+ --my: null,
83
+ /* Appearance */
84
+ --bg: transparent,
85
+ --color: inherit,
86
+ --border: none,
87
+ --radius: 0,
88
+ /* Layout & Sizing */
89
+ --display: block,
90
+ --width: auto,
91
+ --height: auto,
92
+ --max-width: none,
93
+ --align: start
94
+ ) {
95
+ display: var(--display);
96
+
97
+ /*
98
+ * The var() fallback mechanism cleverly handles shorthands.
99
+ * If --px is provided, it's used; otherwise, it falls back to --p.
100
+ */
101
+ padding-inline: var(--px, var(--p));
102
+ padding-block: var(--py, var(--p));
103
+ margin-inline: var(--mx, var(--m));
104
+ margin-block: var(--my, var(--m));
105
+
106
+ width: var(--width);
107
+ height: var(--height);
108
+ max-width: var(--max-width);
109
+
110
+ background-color: var(--bg);
111
+ color: var(--auto-contrast-text, oklch(from var(--bg) clamp(0.1, (var(--l-threshold, 0.65) / l - 1) * 999, 0.98) min(c, var(--c-threshold, 0.08)) h));
112
+ color: var(--color);
113
+ border: var(--border);
114
+ border-radius: var(--radius);
115
+
116
+ text-align: var(--align);
117
+ }
118
+
119
+
120
+ /*
121
+ * ==============================================================================
122
+ * 2. UTILITY CLASSES
123
+ * ==============================================================================
124
+ * A few common UI patterns, built using the --box mixin for consistency.
125
+ */
126
+
127
+ /**
128
+ * .u-panel
129
+ * A general-purpose container with padding, a subtle background, and rounded corners.
130
+ *
131
+ * @example
132
+ * <div class="u-panel">This content is inside a panel.</div>
133
+ */
134
+ .u-panel {
135
+ display: block;
136
+ padding: var(--space-md, 1.5rem);
137
+ background-color: var(--surface-subtle);
138
+ border-radius: var(--radius-lg, 8px);
139
+ @apply --box(
140
+ --p: var(--space-md, 1.5rem),
141
+ --bg: var(--surface-subtle),
142
+ --radius: var(--radius-lg, 8px)
143
+ );
144
+ }
145
+
146
+ /**
147
+ * .u-well
148
+ * An inset panel, often used for code blocks or read-only information.
149
+ *
150
+ * @example
151
+ * <div class="u-well">This content is inside a well.</div>
152
+ */
153
+ .u-well {
154
+ display: block;
155
+ padding: var(--space-md, 1.5rem);
156
+ background-color: var(--surface-muted);
157
+ border: 1px solid var(--outline-muted);
158
+ border-radius: var(--radius-md, 6px);
159
+ @apply --box(
160
+ --p: var(--space-md, 1.5rem),
161
+ --bg: var(--surface-muted),
162
+ --border: 1px solid var(--outline-muted),
163
+ --radius: var(--radius-md, 6px)
164
+ );
165
+ }
166
+
167
+ /**
168
+ * .u-spacer-block
169
+ * A simple utility for adding vertical space between elements.
170
+ * Customize the height with the `--_height` local variable.
171
+ *
172
+ * @example
173
+ * <p>First paragraph.</p>
174
+ * <div class="u-spacer-block" style="--_height: 4rem;"></div>
175
+ * <p>Second paragraph.</p>
176
+ */
177
+ .u-spacer-block {
178
+ --_height: var(--space-lg, 2rem);
179
+ display: block;
180
+ height: var(--_height);
181
+
182
+ @apply --box(
183
+ --display: block,
184
+ --height: var(--_height)
185
+ );
186
+ }
187
+
188
+
189
+ /*
190
+ * ==============================================================================
191
+ * 3. COMPOSITION EXAMPLE: STYLING A CALLOUT COMPONENT
192
+ * ==============================================================================
193
+ * This example shows how you could use the --box mixin to quickly build a new,
194
+ * fully-styled custom component from a semantic element.
195
+ */
196
+ .box-callout-info {
197
+ display: grid;
198
+ padding: var(--space-lg, 2rem);
199
+ background-color: var(--surface-info);
200
+ border: 1px solid var(--info);
201
+ border-radius: var(--radius-lg, 8px);
202
+ /* Apply base styles using the box mixin */
203
+ @apply --box(
204
+ --display: grid,
205
+ --p: var(--space-lg, 2rem),
206
+ --bg: var(--surface-info),
207
+ --border: 1px solid var(--info),
208
+ --radius: var(--radius-lg, 8px)
209
+ );
210
+
211
+ /* Add additional styles specific to this component */
212
+ grid-template-columns: max-content 1fr;
213
+ gap: var(--space-md, 1.5rem);
214
+ align-items: center;
215
+
216
+ &::before {
217
+ content: 'ℹ️'; /* Info icon */
218
+ font-size: 1.5em;
219
+ }
220
+ }
@@ -0,0 +1,75 @@
1
+ /**
2
+ * box.css
3
+ *
4
+ * The "Swiss Army Knife" utility component.
5
+ * ------------------------------------------------------------------------------
6
+ * This component provides a declarative way to control dozens of CSS
7
+ * properties via HTML attributes. It's perfect for one-off layouts,
8
+ * spacers, and custom-styled containers without writing new CSS.
9
+ *
10
+ * @feature {attr() Level 5} - Extensively uses `attr()` with type-or-unit
11
+ * and fallback values for dynamic and robust styling.
12
+ * @feature {Logical Properties} - Uses `padding-inline`, `margin-block`, etc.
13
+ */
14
+
15
+ :is(box, [data-box], .box) {
16
+ /*
17
+ * For each CSS property, we define a custom property that reads its value
18
+ * from an HTML attribute using attr(). A fallback value is always provided.
19
+ */
20
+
21
+ /* Display & Layout */
22
+ --display: attr(display type(*), block);
23
+ --gap: attr(gap type(*), 0);
24
+
25
+ /* Spacing (using logical properties) */
26
+ --padding: attr(p type(*), 0);
27
+ --padding-inline: attr(px type(*), var(--padding));
28
+ --padding-block: attr(py type(*), var(--padding));
29
+ --margin: attr(m type(*), 0);
30
+ --margin-inline: attr(mx type(*), var(--margin));
31
+ --margin-block: attr(my type(*), var(--margin));
32
+
33
+ /* Sizing */
34
+ --width: attr(width type(*), auto);
35
+ --height: attr(height type(*), auto);
36
+ --max-width: attr(max-width type(*), none);
37
+
38
+ /* Appearance */
39
+ --color: attr(color type(*), inherit);
40
+ --border: attr(border type(*), none);
41
+ --radius: attr(radius type(*), 0);
42
+
43
+ /* Typography */
44
+ --text-align: attr(align type(*), start);
45
+
46
+ /* Apply the variables to the actual CSS properties */
47
+ display: var(--display);
48
+ gap: var(--gap);
49
+ padding-inline: var(--padding-inline);
50
+ padding-block: var(--padding-block);
51
+ margin-inline: var(--margin-inline);
52
+ margin-block: var(--margin-block);
53
+ width: var(--width);
54
+ height: var(--height);
55
+ max-width: var(--max-width);
56
+ background: attr(bg type(*), transparent);
57
+ color: var(--color);
58
+ border: var(--border);
59
+ border-radius: var(--radius);
60
+ text-align: var(--text-align);
61
+
62
+ /*
63
+ * Example of using a mixin for more complex styles.
64
+ * A box with `elevation="2"` would receive a pre-defined shadow.
65
+ */
66
+ &[elevation] {
67
+ /* @apply --elevation(attr(elevation type(*))); */
68
+ }
69
+
70
+ /* Only propagate --bg when a bg attribute is explicitly set.
71
+ This lets --bg inherit through non-bg boxes to reach <text> etc. */
72
+ &[bg] {
73
+ --bg: attr(bg type(*));
74
+ }
75
+ }
@@ -0,0 +1,130 @@
1
+ /**
2
+ * card.css
3
+ *
4
+ * A token-first card with custom-element, data, and class hosts.
5
+ */
6
+
7
+ :is(card, [data-card], .card) {
8
+ --_card-background: var(--card-background, var(--surface-default));
9
+ --_card-color: var(--card-color, var(--text-default));
10
+ --_card-border-color: var(--card-border-color, var(--outline-subtle, var(--outline, currentColor)));
11
+ --_card-border-width: var(--card-border-width, var(--border-width, 1px));
12
+ --_card-radius: var(--card-radius, var(--radius-lg, 0.75rem));
13
+ --_card-padding: var(--card-padding, var(--space-lg, 1.5rem));
14
+ --_card-gap: var(--card-gap, var(--space-sm, 0.75rem));
15
+
16
+ container: card-container / inline-size;
17
+ display: flex;
18
+ min-inline-size: 0;
19
+ flex-direction: column;
20
+ overflow: hidden;
21
+ border: var(--_card-border-width) solid var(--_card-border-color);
22
+ border-radius: var(--_card-radius);
23
+ background: var(--_card-background);
24
+ color: var(--_card-color);
25
+ box-shadow: var(--card-shadow, none);
26
+ transition: transform var(--transition-duration, 150ms) var(--transition-timing, ease-out),
27
+ box-shadow var(--transition-duration, 150ms) var(--transition-timing, ease-out);
28
+ }
29
+
30
+ :is(card, [data-card], .card):is(:hover, :focus-within) {
31
+ transform: var(--card-hover-transform, translateY(-2px));
32
+ box-shadow: var(--card-hover-shadow, var(--shadow-sm, none));
33
+ }
34
+
35
+ :is(card-media, [data-card-media], .card-media) {
36
+ display: block;
37
+ min-inline-size: 0;
38
+ aspect-ratio: var(--card-media-ratio, 16 / 9);
39
+ overflow: hidden;
40
+ background: var(--card-media-background, var(--surface-subtle));
41
+ }
42
+
43
+ :is(card-media, [data-card-media], .card-media) > :is(img, video) {
44
+ inline-size: 100%;
45
+ block-size: 100%;
46
+ object-fit: var(--card-media-fit, cover);
47
+ }
48
+
49
+ :is(card-body, [data-card-body], .card-body) {
50
+ display: flex;
51
+ min-inline-size: 0;
52
+ flex: 1;
53
+ flex-direction: column;
54
+ gap: var(--_card-gap);
55
+ padding: var(--_card-padding);
56
+ }
57
+
58
+ :is(card-header, [data-card-header], .card-header) {
59
+ display: block;
60
+ color: var(--card-heading-color, var(--text-overt));
61
+ font-family: var(--font-family-heading, inherit);
62
+ font-size: var(--card-heading-size, var(--font-size-card-title, var(--font-size-xl, 1.25rem)));
63
+ font-weight: var(--card-heading-weight, var(--font-weight-heading, var(--font-weight-semibold, 600)));
64
+ line-height: var(--line-height-card-title, var(--line-height-heading, 1.2));
65
+ }
66
+
67
+ /* Direct regions own their insets; regions nested in card-body use its inset. */
68
+ :is(card, [data-card], .card) > :is(card-header, [data-card-header], .card-header) {
69
+ padding: var(--card-header-padding, var(--_card-padding));
70
+ }
71
+
72
+ @supports selector(:has(*)) {
73
+ :is(card, [data-card], .card):has(> :is(card-body, [data-card-body], .card-body))
74
+ > :is(card-header, [data-card-header], .card-header) {
75
+ padding-block-end: var(--card-header-padding-block-end, 0);
76
+ }
77
+ }
78
+
79
+ :is(card-content, [data-card-content], .card-content) {
80
+ display: block;
81
+ flex: 1;
82
+ color: var(--card-content-color, var(--text-default));
83
+ }
84
+
85
+ :is(card-content, [data-card-content], .card-content) > :first-child,
86
+ :is(card-footer, [data-card-footer], .card-footer) > :first-child {
87
+ margin-block-start: 0;
88
+ }
89
+
90
+ :is(card-content, [data-card-content], .card-content) > :last-child,
91
+ :is(card-footer, [data-card-footer], .card-footer) > :last-child {
92
+ margin-block-end: 0;
93
+ }
94
+
95
+ :is(card-footer, [data-card-footer], .card-footer) {
96
+ display: block;
97
+ margin-block-start: auto;
98
+ color: var(--card-footer-color, var(--text-subtle));
99
+ font-size: var(--card-footer-size, var(--font-size-meta, var(--font-size-sm, 0.875rem)));
100
+ line-height: var(--line-height-meta, var(--line-height-snug, 1.375));
101
+ }
102
+
103
+ :is(card, [data-card], .card) > :is(card-footer, [data-card-footer], .card-footer) {
104
+ padding: var(--card-footer-padding, var(--_card-padding));
105
+ }
106
+
107
+ @supports selector(:has(*)) {
108
+ :is(card, [data-card], .card):has(> :is(card-body, [data-card-body], .card-body))
109
+ > :is(card-footer, [data-card-footer], .card-footer) {
110
+ padding-block-start: var(--card-footer-padding-block-start, 0);
111
+ }
112
+ }
113
+
114
+ @container card-container (min-width: 32rem) {
115
+ :is(card, [data-card], .card)[data-card-layout="adaptive"],
116
+ :is(card, [data-card], .card):not([data-card-layout]) {
117
+ flex-direction: row;
118
+ }
119
+
120
+ :is(card, [data-card], .card)[data-card-layout="adaptive"] > :is(card-media, [data-card-media], .card-media),
121
+ :is(card, [data-card], .card):not([data-card-layout]) > :is(card-media, [data-card-media], .card-media) {
122
+ flex: 0 0 var(--card-media-width, 10rem);
123
+ aspect-ratio: 1;
124
+ }
125
+ }
126
+
127
+ @media (prefers-reduced-motion: reduce) {
128
+ :is(card, [data-card], .card) { transition: none; }
129
+ :is(card, [data-card], .card):is(:hover, :focus-within) { transform: none; }
130
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * carousel.css
3
+ *
4
+ * Styles for a responsive and touch-friendly carousel.
5
+ * ------------------------------------------------------------------------------
6
+ * @feature {CSS Custom Properties} - For easy customization of animation.
7
+ * @feature {backdrop-filter} - For modern "glassmorphism" button effects.
8
+ * @feature {Scroll Snap} (Progressive Enhancement) - Provides a JS-free fallback.
9
+ */
10
+
11
+ :is(carousel, [data-carousel], .carousel) {
12
+ --slide-duration: attr(duration type(*), 500ms);
13
+ --slide-timing: attr(timing-function type(*), cubic-bezier(0.4, 0, 0.2, 1));
14
+
15
+ position: relative;
16
+ display: block;
17
+ overflow: hidden;
18
+ border-radius: attr(radius type(*), 0.75rem);
19
+ width: attr(width type(*), 100%);
20
+ max-inline-size: 100%;
21
+ }
22
+
23
+ /*
24
+ * The slides container can use scroll-snapping as a JS-free enhancement.
25
+ * The JS will override this with transform-based animation if it loads.
26
+ */
27
+ :is(.carousel-slides, [data-carousel-slides]) {
28
+ display: flex;
29
+ overflow-x: auto;
30
+ scroll-snap-type: x mandatory;
31
+ scrollbar-width: none; /* Hide scrollbar in Firefox */
32
+ -ms-overflow-style: none; /* Hide scrollbar in IE/Edge */
33
+ transition: transform var(--slide-duration) var(--slide-timing);
34
+ @media (prefers-reduced-motion: reduce) {
35
+ transition: none;
36
+ }
37
+
38
+ &::-webkit-scrollbar { display: none; } /* Hide scrollbar in WebKit */
39
+ }
40
+
41
+ :is(carousel-item, [data-carousel-item], .carousel-item) {
42
+ flex-shrink: 0;
43
+ scroll-snap-align: start;
44
+ }
45
+
46
+ :is(carousel-trigger, [data-carousel-trigger], .carousel-trigger) {
47
+ position: absolute;
48
+ top: 50%;
49
+ transform: translateY(-50%);
50
+ z-index: 10;
51
+ background-color: oklch(from var(--theme-bg) l c h / 0.5);
52
+ backdrop-filter: blur(5px);
53
+ color: var(--theme-text);
54
+ border: 1px solid transparent;
55
+ border-radius: 50%;
56
+ width: 2.75rem;
57
+ height: 2.75rem;
58
+ display: grid;
59
+ place-items: center;
60
+ cursor: pointer;
61
+ transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
62
+
63
+ &:hover {
64
+ background-color: oklch(from var(--theme-bg) l c h / 0.8);
65
+ border-color: var(--theme-primary);
66
+ }
67
+
68
+ &[direction="prev"] { inset-inline-start: 1rem; }
69
+ &[direction="next"] { inset-inline-end: 1rem; }
70
+
71
+ &[disabled] {
72
+ opacity: 0.3;
73
+ cursor: not-allowed;
74
+ pointer-events: none;
75
+ }
76
+ }
@@ -0,0 +1,71 @@
1
+ /* chip.css */
2
+
3
+ :is(chip, [data-chip], .chip) {
4
+ display: inline-flex;
5
+ align-items: center;
6
+ gap: var(--chip-gap, var(--l-gap, 0.5em));
7
+ --b-bg: var(--chip-bg, var(--surface-subtle));
8
+ --b-bw: var(--chip-border-width, var(--border-width, 1px));
9
+ --b-bc: var(--chip-border-color, var(--outline-subtle));
10
+ --b-fg: var(--chip-color, var(--text-default));
11
+ --b-r: var(--chip-radius, var(--border-radius-full, 9999px));
12
+ --b-py: var(--chip-padding-block, 0.35em);
13
+ --b-px: var(--chip-padding-inline, 0.75em);
14
+ background-color: var(--b-bg);
15
+ border: var(--b-bw) solid var(--b-bc);
16
+ border-radius: var(--b-r);
17
+ color: var(--b-fg);
18
+ padding: var(--b-py) var(--b-px);
19
+ font-size: 0.9em;
20
+ line-height: 1;
21
+ }
22
+
23
+ @supports (text-box: trim-both cap alphabetic) {
24
+ :is(chip, [data-chip], .chip) {
25
+ text-box: var(--text-box-chip, var(--text-box-ui));
26
+ }
27
+ }
28
+
29
+ @supports (text-box-trim: trim-both) and (text-box-edge: cap alphabetic) {
30
+ :is(chip, [data-chip], .chip) {
31
+ text-box-trim: var(--text-box-trim-chip, var(--text-box-trim-ui));
32
+ text-box-edge: var(--text-box-edge-chip, var(--text-box-edge-ui));
33
+ }
34
+ }
35
+
36
+ :is(chip, [data-chip], .chip):is([size="sm"], [data-size="sm"], .chip-sm) { --b-py: 0.25em; --b-px: 0.6em; font-size: 0.85em; }
37
+ :is(chip, [data-chip], .chip):is([size="md"], [data-size="md"], .chip-md) { --b-py: 0.35em; --b-px: 0.75em; font-size: 0.9em; }
38
+ :is(chip, [data-chip], .chip):is([size="lg"], [data-size="lg"], .chip-lg) { --b-py: 0.5em; --b-px: 0.9em; font-size: 1em; }
39
+
40
+ :is(chip, [data-chip], .chip):is([removable], [data-removable]):focus-visible {
41
+ outline: var(--focus-ring-width, 2px) var(--focus-ring-style, solid) var(--focus-ring-color, currentColor);
42
+ outline-offset: 2px;
43
+ }
44
+
45
+ :is(chip, [data-chip], .chip):is([removable], [data-removable]):hover { filter: brightness(1.02); }
46
+
47
+ :is(chip, [data-chip], .chip):is([removable], [data-removable])::after {
48
+ content: "✕";
49
+ display: inline-block;
50
+ margin-inline-start: 0.25em;
51
+ font-size: 0.9em;
52
+ opacity: 0.7;
53
+ }
54
+
55
+ :is(chip, [data-chip], .chip):is([variant="default"], [data-variant="default"], .chip-default, [role="default"]) {
56
+ --b-bg: var(--chip-bg, var(--surface-default));
57
+ --b-bc: var(--chip-border-color, var(--outline-default));
58
+ --b-fg: var(--chip-color, var(--text-default));
59
+ }
60
+
61
+ :is(chip, [data-chip], .chip):is([variant="overt"], [data-variant="overt"], .chip-overt, [role="overt"]) {
62
+ --b-bg: var(--chip-bg, var(--surface-overt));
63
+ --b-bc: var(--chip-border-color, var(--outline-overt));
64
+ --b-fg: var(--chip-color, var(--text-on-surface-overt, var(--text-overt)));
65
+ }
66
+
67
+ :is(chip, [data-chip], .chip):is([variant="muted"], [data-variant="muted"], .chip-muted, [role="muted"]) {
68
+ --b-bg: var(--chip-bg, var(--surface-muted));
69
+ --b-bc: var(--chip-border-color, var(--outline-muted, var(--outline-subtle)));
70
+ --b-fg: var(--chip-color, var(--text-subtle));
71
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * container.css
3
+ *
4
+ * A responsive container powered by CSS Style Queries.
5
+ * ------------------------------------------------------------------------------
6
+ * This component is a showcase of modern CSS architecture. It contains no
7
+ * media queries. Instead, it reacts to the global `--breakpoint-active` variable
8
+ * set on an ancestor (e.g., <body>), making it truly context-aware.
9
+ *
10
+ * @feature {Style Queries} - `@container style(...)` makes the component
11
+ * react to the computed value of a parent's custom property.
12
+ * @feature {Logical Properties} - `margin-inline` for automatic LTR/RTL support.
13
+ * @feature {attr()} - For per-element overrides of max-width values.
14
+ */
15
+
16
+ :is(container, [data-container], .container) {
17
+ /*
18
+ * 1. Define the max-width values for EACH possible state.
19
+ * These can be overridden per-element with HTML attributes.
20
+ */
21
+ --mw-sm: attr(max-width-sm type(*), 100%);
22
+ --mw-md: attr(max-width-md type(*), 768px);
23
+ --mw-lg: attr(max-width-lg type(*), 1024px);
24
+ --mw-xl: attr(max-width-xl type(*), 1280px);
25
+
26
+ /*
27
+ * 2. Initialize the master variable and apply base styles.
28
+ * It defaults to the largest size.
29
+ */
30
+ --container-max-width: var(--mw-xl);
31
+ --container-padding-inline: attr(pad type(*), 1.5rem);
32
+
33
+ display: block;
34
+ width: 100%;
35
+ margin-inline: auto; /* auto centers the container */
36
+ padding-inline: var(--container-padding-inline);
37
+ max-width: var(--container-max-width);
38
+ }
39
+
40
+ /*
41
+ * 3. Use Style Queries to update the master variable.
42
+ * The component checks the value of `--breakpoint-active` from its query
43
+ * container (e.g., <body>) and updates its own max-width accordingly.
44
+ */
45
+ @container style(--breakpoint-active = lg) {
46
+ :is(container, [data-container], .container) { --container-max-width: var(--mw-lg); }
47
+ }
48
+
49
+ @container style(--breakpoint-active = md) {
50
+ :is(container, [data-container], .container) { --container-max-width: var(--mw-md); }
51
+ }
52
+
53
+ @container style(--breakpoint-active = sm) {
54
+ :is(container, [data-container], .container) { --container-max-width: var(--mw-sm); }
55
+ }