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,348 @@
1
+
2
+ /**
3
+ * layouts.css
4
+ *
5
+ * A definitive library of declarative, property-driven layout components.
6
+ * ------------------------------------------------------------------------------
7
+ * This file provides a set of powerful, reusable layout patterns as custom
8
+ * elements that are deeply integrated with the library's design token system.
9
+ *
10
+ * --- PHILOSOPHY ---
11
+ * - Declarative & Semantic: Use `<layout-grid>` instead of `.l-grid`.
12
+ * - Property-Driven: Core logic is controlled by CSS Custom Properties (e.g., `--l-gap`),
13
+ * which can be overridden by HTML attributes for convenience.
14
+ * - Token-Integrated: Default values are pulled from global design tokens
15
+ * (e.g., `--space-md`, `--bp-md`) defined in `base.css`.
16
+ * - Composable & Context-Aware: Layouts are designed to be nested and use
17
+ * container queries to adapt to their local context.
18
+ *
19
+ * This file should be imported into the `components` layer in `index.css`.
20
+ */
21
+
22
+ /*
23
+ * ==============================================================================
24
+ * DEFAULTS & BASE BEHAVIORS
25
+ * ==============================================================================
26
+ *
27
+ * We use `:where()` to set default variable values with ZERO specificity.
28
+ * This makes them trivial for developers to override at any level.
29
+ */
30
+ :where(layout-grid, [data-layout-grid], .layout-grid, layout-split, [data-layout-split], .layout-split, layout-stack, [data-layout-stack], .layout-stack, layout-cluster, [data-layout-cluster], .layout-cluster, layout-reel, [data-layout-reel], .layout-reel, layout-switcher, [data-layout-switcher], .layout-switcher, layout-pad, [data-layout-pad], .layout-pad, layout-center, [data-layout-center], .layout-center, layout-inline-center, [data-layout-inline-center], .layout-inline-center, layout-frame, [data-layout-frame], .layout-frame, layout-sidebar, [data-layout-sidebar], .layout-sidebar, layout-page, [data-layout-page], .layout-page) {
31
+ /*
32
+ * Default values for layout properties, pulling from global tokens.
33
+ * Assume tokens like `--space-md`, `--bp-md` are defined in `base.css`.
34
+ */
35
+ --l-gap: var(--space-md, 1.5rem);
36
+ --l-breakpoint: var(--bp-sm, 30em);
37
+ --l-padding: var(--space-md, 1.5rem);
38
+ --l-fraction: 1fr;
39
+ --l-justify: flex-start;
40
+ --l-align: stretch;
41
+ }
42
+
43
+ /* Base styles for all layout components */
44
+ :where(layout-grid, [data-layout-grid], .layout-grid, layout-split, [data-layout-split], .layout-split, layout-stack, [data-layout-stack], .layout-stack, layout-cluster, [data-layout-cluster], .layout-cluster, layout-reel, [data-layout-reel], .layout-reel, layout-switcher, [data-layout-switcher], .layout-switcher, layout-pad, [data-layout-pad], .layout-pad, layout-center, [data-layout-center], .layout-center, layout-inline-center, [data-layout-inline-center], .layout-inline-center, layout-frame, [data-layout-frame], .layout-frame, layout-sidebar, [data-layout-sidebar], .layout-sidebar, layout-page, [data-layout-page], .layout-page) {
45
+ display: block;
46
+
47
+ /* Prevent children from overflowing their container */
48
+ & > * {
49
+ min-inline-size: 0;
50
+ max-inline-size: 100%;
51
+ }
52
+ }
53
+
54
+ /*
55
+ * Size containment changes intrinsic sizing. Keep it opt-in so a layout used
56
+ * as a flex/grid item sizes from its children unless it actually owns queries.
57
+ */
58
+ :where(layout-grid, [data-layout-grid], .layout-grid, layout-split, [data-layout-split], .layout-split, layout-stack, [data-layout-stack], .layout-stack, layout-cluster, [data-layout-cluster], .layout-cluster, layout-reel, [data-layout-reel], .layout-reel, layout-switcher, [data-layout-switcher], .layout-switcher, layout-pad, [data-layout-pad], .layout-pad, layout-center, [data-layout-center], .layout-center, layout-inline-center, [data-layout-inline-center], .layout-inline-center, layout-frame, [data-layout-frame], .layout-frame, layout-sidebar, [data-layout-sidebar], .layout-sidebar, layout-page, [data-layout-page], .layout-page):is([container-query], [data-container-query], .layout-container) {
59
+ container-type: inline-size;
60
+ container-name: var(--layout-container-name, layout-container);
61
+ }
62
+
63
+ /*
64
+ * ==============================================================================
65
+ * GRID-BASED LAYOUTS
66
+ * ==============================================================================
67
+ */
68
+
69
+ /**
70
+ * <layout-grid>
71
+ * A responsive grid that automatically fits columns.
72
+ * @prop --l-min-item-size: The minimum size for each item.
73
+ * @prop --l-gap: The gap between items.
74
+ * @attr min-item-size, gap
75
+ */
76
+ :is(layout-grid, [data-layout-grid], .layout-grid) {
77
+ --_min-item-size: attr(min-item-size type(*), var(--l-min-item-size, 16rem));
78
+ --_gap: attr(gap type(*), var(--l-gap));
79
+
80
+ display: grid;
81
+ gap: var(--_gap, var(--l-gap));
82
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--_min-item-size)), 1fr));
83
+ }
84
+
85
+ /**
86
+ * <layout-split>
87
+ * A two-column layout that splits at a breakpoint.
88
+ * @prop --l-fraction: The ratio for the first column (e.g., "2fr").
89
+ * @prop --l-breakpoint: The container width to split at.
90
+ * @prop --l-gap: The gap between columns.
91
+ * @attr fraction, breakpoint, gap, force-stack, no-stack
92
+ */
93
+ :is(layout-split, [data-layout-split], .layout-split) {
94
+ --_fraction: attr(fraction type(*), var(--l-fraction, 1fr));
95
+ --_breakpoint: attr(breakpoint type(*), var(--l-breakpoint));
96
+ --_gap: attr(gap type(*), var(--l-gap));
97
+
98
+ display: grid;
99
+ gap: var(--_gap, var(--l-gap));
100
+ grid-template-columns: 1fr; /* Default to stacked */
101
+ }
102
+ @media (min-width: 30em) {
103
+ :is(layout-split, [data-layout-split], .layout-split):not([force-stack], [data-force-stack], .layout-split-force-stack) {
104
+ grid-template-columns: var(--_fraction, 1fr 1fr);
105
+ }
106
+ }
107
+ :is(layout-split, [data-layout-split], .layout-split):is([no-stack], [data-no-stack], .layout-split-no-stack) {
108
+ grid-template-columns: var(--_fraction, 1fr 1fr);
109
+ }
110
+
111
+ /*
112
+ * ==============================================================================
113
+ * FLEXBOX-BASED LAYOUTS
114
+ * ==============================================================================
115
+ */
116
+
117
+ /**
118
+ * <layout-stack>
119
+ * A vertical stack with consistent spacing.
120
+ * @prop --l-gap, --l-align
121
+ * @attr gap, align
122
+ */
123
+ :is(layout-stack, [data-layout-stack], .layout-stack) {
124
+ --_gap: attr(gap type(*), var(--l-gap));
125
+ --_align: attr(align type(*), var(--l-align, stretch));
126
+
127
+ display: flex;
128
+ flex-direction: column;
129
+ justify-content: flex-start;
130
+ align-items: var(--_align, stretch);
131
+ gap: var(--_gap, var(--l-gap));
132
+
133
+ /* A stack owns vertical rhythm; child margins would otherwise double it. */
134
+ & > * {
135
+ inline-size: 100%;
136
+ margin-block: 0;
137
+ }
138
+
139
+ &[center] {
140
+ align-items: center;
141
+ }
142
+
143
+ &[center] > :is(h1, h2, h3, h4, h5, h6, p, small, span, blockquote, pre, a, button, label, summary, details) {
144
+ text-align: center;
145
+ }
146
+ }
147
+
148
+ :is(layout-stack, [data-layout-stack], .layout-stack) > .stack-intrinsic {
149
+ flex-grow: 0;
150
+ inline-size: fit-content;
151
+ max-inline-size: max-content;
152
+ align-self: var(--stack-intrinsic-align, flex-start);
153
+ }
154
+
155
+ :is(layout-stack, [data-layout-stack], .layout-stack)[center] > .stack-intrinsic {
156
+ --stack-intrinsic-align: center;
157
+ }
158
+
159
+ /**
160
+ * <layout-cluster>
161
+ * For grouping items that wrap onto new lines.
162
+ * @prop --l-gap, --l-justify, --l-align
163
+ * @attr gap, justify, align
164
+ */
165
+ :is(layout-cluster, [data-layout-cluster], .layout-cluster) {
166
+ --_gap: attr(gap type(*), var(--space-sm, 0.75rem));
167
+ --_justify: attr(justify type(*), var(--l-justify, flex-start));
168
+ --_align: attr(align type(*), var(--l-align, center));
169
+
170
+ display: flex;
171
+ flex-wrap: wrap;
172
+ gap: var(--_gap, var(--l-gap));
173
+ justify-content: var(--_justify, flex-start);
174
+ align-items: var(--_align, stretch);
175
+ }
176
+
177
+ /**
178
+ * <layout-reel>
179
+ * A horizontally scrolling container.
180
+ * @prop --l-gap, --scrollbar-thumb, --scrollbar-track
181
+ * @attr gap, no-scrollbar
182
+ */
183
+ :is(layout-reel, [data-layout-reel], .layout-reel) {
184
+ --_gap: attr(gap type(*), var(--l-gap));
185
+ --_thumb: var(--scrollbar-thumb, oklch(from var(--theme-primary) l c h / 0.5));
186
+ --_track: var(--scrollbar-track, oklch(from var(--theme-bg) l c h / 0.5));
187
+
188
+ display: flex;
189
+ gap: var(--_gap, var(--l-gap));
190
+ overflow-x: auto;
191
+ scrollbar-width: thin;
192
+ scrollbar-color: var(--_thumb) var(--_track);
193
+
194
+ & > * { flex-shrink: 0; }
195
+ &[no-scrollbar] { scrollbar-width: none; &::-webkit-scrollbar { display: none; } }
196
+ }
197
+
198
+ /**
199
+ * <layout-switcher>
200
+ * Switches from a stack to a row when items have enough space.
201
+ * @prop --l-threshold, --l-gap
202
+ * @attr threshold, gap
203
+ */
204
+ :is(layout-switcher, [data-layout-switcher], .layout-switcher) {
205
+ --_threshold: attr(threshold type(*), var(--l-threshold, 30rem));
206
+ --_gap: attr(gap type(*), var(--l-gap));
207
+
208
+ display: flex;
209
+ flex-wrap: wrap;
210
+ gap: var(--_gap, var(--l-gap));
211
+
212
+ & > * {
213
+ flex-grow: 1;
214
+ flex-basis: calc((var(--_threshold) - 100%) * 999);
215
+ }
216
+ }
217
+
218
+ /*
219
+ * ==============================================================================
220
+ * WRAPPER & CENTERING LAYOUTS
221
+ * ==============================================================================
222
+ */
223
+
224
+ /**
225
+ * <layout-pad>
226
+ * Adds consistent padding to its content.
227
+ * @prop --l-padding, --l-padding-inline, --l-padding-block
228
+ * @attr padding, padding-x, padding-y
229
+ */
230
+ :is(layout-pad, [data-layout-pad], .layout-pad) {
231
+ --_padding: attr(padding type(*), var(--l-padding));
232
+ --_padding-inline: attr(padding-x type(*), var(--_padding));
233
+ --_padding-block: attr(padding-y type(*), var(--_padding));
234
+
235
+ padding-inline: var(--_padding-inline);
236
+ padding-block: var(--_padding-block);
237
+ }
238
+
239
+ /**
240
+ * <layout-center>
241
+ * Centers content horizontally with a max-width for readability.
242
+ * @prop --l-max-width, --l-gutters
243
+ * @attr max-width, gutters, and-text
244
+ */
245
+ :is(layout-center, [data-layout-center], .layout-center) {
246
+ --_max-width: attr(max-width type(*), var(--l-max-width, 65ch));
247
+ --_gutters: attr(gutters type(*), var(--l-gutters, var(--space-md, 1.5rem)));
248
+
249
+ box-sizing: border-box;
250
+ margin-inline: auto;
251
+ max-width: var(--_max-width);
252
+ padding-inline: var(--_gutters);
253
+ &[and-text] { text-align: center; }
254
+ }
255
+
256
+ /**
257
+ * <layout-inline-center>
258
+ * Centers content horizontally without a max-width constraint.
259
+ * @prop --l-gutters
260
+ * @attr gutters, and-text
261
+ */
262
+ :is(layout-inline-center, [data-layout-inline-center], .layout-inline-center) {
263
+ --_gutters: attr(gutters type(*), var(--l-gutters, var(--space-md, 1.5rem)));
264
+
265
+ box-sizing: border-box;
266
+ margin-inline: auto;
267
+ padding-inline: var(--_gutters);
268
+ &[and-text] { text-align: center; }
269
+ }
270
+
271
+ /**
272
+ * <layout-frame>
273
+ * Creates a responsive container for media with a fixed aspect ratio.
274
+ * @prop --l-aspect-ratio
275
+ * @attr ratio
276
+ */
277
+ :is(layout-frame, [data-layout-frame], .layout-frame) {
278
+ --_ratio: attr(ratio type(*), var(--l-aspect-ratio, 16 / 9));
279
+ position: relative;
280
+ overflow: hidden;
281
+ aspect-ratio: var(--_ratio);
282
+
283
+ & > :is(img, video) {
284
+ position: absolute;
285
+ inset: 0;
286
+ width: 100%; height: 100%;
287
+ object-fit: cover;
288
+ }
289
+ }
290
+
291
+ /*
292
+ * ==============================================================================
293
+ * COMPLEX LAYOUT PATTERNS
294
+ * ==============================================================================
295
+ */
296
+
297
+ /**
298
+ * <layout-sidebar>
299
+ * A sidebar layout that stacks on small containers.
300
+ * @prop --l-breakpoint, --l-side-width, --l-content-min, --l-gap
301
+ * @attr breakpoint, side-width, side, gap
302
+ */
303
+ :is(layout-sidebar, [data-layout-sidebar], .layout-sidebar) {
304
+ --_breakpoint: attr(breakpoint type(*), var(--l-breakpoint));
305
+ --_side-width: attr(side-width type(*), var(--l-side-width, 20rem));
306
+ --_content-min: attr(content-min-width type(*), var(--l-content-min, 50%));
307
+ --_gap: attr(gap type(*), var(--l-gap));
308
+
309
+ display: flex;
310
+ flex-wrap: wrap;
311
+ gap: var(--_gap, var(--l-gap));
312
+
313
+ /* The "switcher" logic for the main content area */
314
+ & > :not(:is([slot="aside"], [data-layout-sidebar-aside], .layout-sidebar__aside)) {
315
+ flex-grow: 9999;
316
+ flex-basis: var(--_content-min);
317
+ }
318
+
319
+ /* Sidebar sizing */
320
+ & > :is([slot="aside"], [data-layout-sidebar-aside], .layout-sidebar__aside) {
321
+ flex-grow: 1;
322
+ flex-basis: var(--_side-width);
323
+ }
324
+
325
+ /* Handle right-side sidebar using order */
326
+ &[side="right"] > :is([slot="aside"], [data-layout-sidebar-aside], .layout-sidebar__aside) {
327
+ order: 1;
328
+ }
329
+ }
330
+
331
+ /**
332
+ * <layout-page>
333
+ * A standard page layout with header, main content, and footer rows.
334
+ * @prop --l-min-height, --l-gap
335
+ * @attr min-height, gap
336
+ */
337
+ :is(layout-page, [data-layout-page], .layout-page) {
338
+ --_min-height: attr(min-height type(*), var(--l-min-height, 100vh));
339
+ --_gap: attr(gap type(*), var(--l-gap, 0));
340
+
341
+ display: grid;
342
+ grid-template-rows: auto 1fr auto;
343
+ min-height: var(--_min-height);
344
+ gap: var(--_gap, var(--l-gap));
345
+ }
346
+ :is(layout-page, [data-layout-page], .layout-page) > [slot="header"] { grid-row: 1; }
347
+ :is(layout-page, [data-layout-page], .layout-page) > [slot="main"] { grid-row: 2; }
348
+ :is(layout-page, [data-layout-page], .layout-page) > [slot="footer"] { grid-row: 3; }
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "css-tags",
3
+ "version": "0.1.0",
4
+ "description": "Token-first CSS for semantic HTML, custom tags, data attributes, and class hosts.",
5
+ "keywords": [
6
+ "css",
7
+ "design-system",
8
+ "semantic-html",
9
+ "custom-elements",
10
+ "css-framework",
11
+ "oklch",
12
+ "components"
13
+ ],
14
+ "homepage": "https://doeixd.github.io/CSS-Tags/",
15
+ "bugs": {
16
+ "url": "https://github.com/doeixd/CSS-Tags/issues"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/doeixd/CSS-Tags.git"
21
+ },
22
+ "license": "MIT",
23
+ "author": "Patrick Glenn <doeixd@gmail.com>",
24
+ "type": "module",
25
+ "style": "index.css",
26
+ "types": "types/css-tags.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./types/css-tags.d.ts",
30
+ "default": "./index.css"
31
+ },
32
+ "./index.css": "./index.css",
33
+ "./types": "./types/css-tags.d.ts",
34
+ "./components/*": "./components/*",
35
+ "./core/*": "./core/*",
36
+ "./layouts/*": "./layouts/*",
37
+ "./themes/*": "./themes/*",
38
+ "./utilities/*": "./utilities/*",
39
+ "./carousel.js": "./carousel.js",
40
+ "./view-transition.js": "./view-transition.js",
41
+ "./theme-generator.css": "./theme-generator.css"
42
+ },
43
+ "files": [
44
+ "index.css",
45
+ "components",
46
+ "core",
47
+ "layouts",
48
+ "themes",
49
+ "utilities",
50
+ "types/css-tags.d.ts",
51
+ "carousel.js",
52
+ "view-transition.js",
53
+ "theme-generator.css"
54
+ ],
55
+ "sideEffects": [
56
+ "*.css",
57
+ "**/*.css"
58
+ ],
59
+ "publishConfig": {
60
+ "access": "public",
61
+ "provenance": true
62
+ },
63
+ "engines": {
64
+ "node": ">=18"
65
+ }
66
+ }