@codenhub/styles 0.7.0 → 0.9.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.
- package/README.es.md +9 -8
- package/README.md +8 -7
- package/README.pt-BR.md +9 -8
- package/dist/aesthetics/chunky-tile.css +1 -1
- package/dist/aesthetics/cyber.css +1 -1
- package/dist/aesthetics/glass.css +1 -1
- package/dist/aesthetics/index.css +2 -2
- package/dist/aesthetics/neobrutalism.css +1 -1
- package/dist/aesthetics/pixel.css +1 -1
- package/dist/aesthetics/sketch.css +1 -1
- package/dist/cli.js +358 -0
- package/dist/components.css +50 -2
- package/dist/index.css +50 -2
- package/dist/index.d.ts +1 -0
- package/dist/native.css +50 -2
- package/dist/palette.css +1 -1
- package/dist/purge/classes.json +1 -0
- package/dist/purge/index.css +50 -0
- package/dist/theme.css +2 -2
- package/docs/accessibility.md +46 -27
- package/docs/changelog/0.8.0.md +70 -0
- package/docs/changelog/0.9.0.md +40 -0
- package/docs/changelog/index.md +2 -0
- package/docs/es/accessibility.md +47 -28
- package/docs/es/index.md +4 -3
- package/docs/es/integrating/index.md +38 -10
- package/docs/es/integrating/tailwind.md +79 -8
- package/docs/es/integrating/without-a-bundler.md +157 -5
- package/docs/es/setup.md +43 -34
- package/docs/es/usage/aesthetics.md +20 -14
- package/docs/es/usage/buttons.md +6 -2
- package/docs/es/usage/composing.md +6 -2
- package/docs/es/usage/content-and-layout.md +10 -4
- package/docs/es/usage/customizing.md +46 -26
- package/docs/es/usage/feedback.md +5 -1
- package/docs/es/usage/forms.md +30 -5
- package/docs/es/usage/index.md +7 -3
- package/docs/es/usage/presets.md +92 -0
- package/docs/es/usage/solo.md +4 -2
- package/docs/es/usage/theming.md +29 -16
- package/docs/es/usage/tooltips.md +2 -2
- package/docs/index.md +3 -2
- package/docs/integrating/index.md +38 -10
- package/docs/integrating/tailwind.md +78 -7
- package/docs/integrating/without-a-bundler.md +156 -4
- package/docs/pt-BR/accessibility.md +47 -28
- package/docs/pt-BR/index.md +4 -3
- package/docs/pt-BR/integrating/index.md +38 -10
- package/docs/pt-BR/integrating/tailwind.md +79 -8
- package/docs/pt-BR/integrating/without-a-bundler.md +157 -5
- package/docs/pt-BR/setup.md +43 -34
- package/docs/pt-BR/usage/aesthetics.md +20 -14
- package/docs/pt-BR/usage/buttons.md +6 -2
- package/docs/pt-BR/usage/composing.md +6 -2
- package/docs/pt-BR/usage/content-and-layout.md +10 -4
- package/docs/pt-BR/usage/customizing.md +46 -26
- package/docs/pt-BR/usage/feedback.md +5 -1
- package/docs/pt-BR/usage/forms.md +30 -5
- package/docs/pt-BR/usage/index.md +7 -3
- package/docs/pt-BR/usage/presets.md +92 -0
- package/docs/pt-BR/usage/solo.md +4 -2
- package/docs/pt-BR/usage/theming.md +22 -9
- package/docs/pt-BR/usage/tooltips.md +2 -2
- package/docs/setup.md +31 -22
- package/docs/usage/aesthetics.md +19 -13
- package/docs/usage/buttons.md +5 -1
- package/docs/usage/composing.md +5 -1
- package/docs/usage/content-and-layout.md +9 -3
- package/docs/usage/customizing.md +45 -25
- package/docs/usage/feedback.md +4 -0
- package/docs/usage/forms.md +29 -4
- package/docs/usage/index.md +6 -2
- package/docs/usage/presets.md +91 -0
- package/docs/usage/solo.md +3 -1
- package/docs/usage/theming.md +21 -8
- package/docs/usage/tooltips.md +1 -1
- package/llms-full.txt +695 -134
- package/llms.txt +3 -2
- package/package.json +117 -65
- package/{dist/tw → tw}/aesthetics/chunky-tile.css +43 -20
- package/{dist/tw → tw}/aesthetics/cyber.css +19 -25
- package/{dist/tw → tw}/aesthetics/glass.css +110 -36
- package/{dist/tw → tw}/aesthetics/neobrutalism.css +41 -21
- package/{dist/tw → tw}/aesthetics/pixel.css +3 -0
- package/tw/aesthetics/sketch.css +435 -0
- package/{dist/tw → tw}/box.css +109 -26
- package/tw/components/button.css +11 -0
- package/tw/components/button.rules.css +187 -0
- package/tw/components/feedback.css +11 -0
- package/{dist/tw/components/feedback.css → tw/components/feedback.rules.css} +156 -33
- package/tw/components/form.css +11 -0
- package/{dist/tw/components/form.css → tw/components/form.rules.css} +584 -141
- package/tw/components/index.css +16 -0
- package/tw/components/rules.css +41 -0
- package/tw/components/surface.css +11 -0
- package/tw/components/surface.rules.css +225 -0
- package/tw/components/tooltip.css +11 -0
- package/{dist/tw/components/tooltip.css → tw/components/tooltip.rules.css} +82 -61
- package/{dist/tw → tw}/corner.css +18 -12
- package/{dist/tw → tw}/elevation.css +27 -21
- package/{dist/tw → tw}/index.css +11 -9
- package/tw/index.d.ts +1 -0
- package/tw/intent.css +312 -0
- package/tw/modifiers.css +127 -0
- package/tw/native.css +323 -0
- package/tw/presentation.css +139 -0
- package/tw/reset.css +10 -0
- package/{dist/tw/reset.css → tw/reset.rules.css} +7 -8
- package/tw/size.css +34 -0
- package/tw/surface.css +9 -0
- package/tw/surface.rules.css +212 -0
- package/{dist/tw → tw}/theme.css +93 -29
- package/tw/typography.css +8 -0
- package/{dist/tw/typography.css → tw/typography.rules.css} +0 -3
- package/{dist/tw → tw}/utilities/content.css +248 -108
- package/tw/utilities/index.css +11 -0
- package/tw/utilities/layout.css +210 -0
- package/tw/utilities/rules.css +8 -0
- package/dist/tw/aesthetics/sketch.css +0 -398
- package/dist/tw/components/button.css +0 -139
- package/dist/tw/components/index.css +0 -35
- package/dist/tw/components/surface.css +0 -184
- package/dist/tw/intent.css +0 -229
- package/dist/tw/native.css +0 -203
- package/dist/tw/palette.css +0 -460
- package/dist/tw/presentation.css +0 -68
- package/dist/tw/surface.css +0 -61
- package/dist/tw/utilities/index.css +0 -6
- package/dist/tw/utilities/layout.css +0 -144
- /package/{dist/tw → tw}/aesthetics/index.css +0 -0
package/{dist/tw → tw}/index.css
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import "tailwindcss";
|
|
2
2
|
|
|
3
|
-
/* The build has no markup to scan, so Tailwind's automatic content
|
|
4
|
-
sees only this package's own files. The `src/` scan is load-bearing: it is
|
|
3
|
+
/* The compiled build has no markup to scan, so Tailwind's automatic content
|
|
4
|
+
detection sees only this package's own files. The `src/` scan is load-bearing: it is
|
|
5
5
|
how the composition utilities (`box`, `surface`, `text-control`,
|
|
6
6
|
`input-group`) are emitted as standalone rules, so
|
|
7
7
|
`source(none)` is not an option. Tailwind utility names that collide with a
|
|
@@ -9,18 +9,20 @@
|
|
|
9
9
|
`transition`, `transform`, `container`) do not emit, verified against
|
|
10
10
|
Tailwind 4.3.2; `tests/integration/exports.test.ts` guards it.
|
|
11
11
|
|
|
12
|
-
The `@source not` lines keep
|
|
12
|
+
The `@source not` lines keep the build command's TypeScript in `src/cli/`, whose
|
|
13
|
+
prose once shipped as `.relative`, and everything that is not `src/` out of the scan:
|
|
13
14
|
the sibling app and fixture directories, the `docs/` tree, the build scripts,
|
|
14
15
|
and the root prose, data, config, and license files. Without them a class
|
|
15
16
|
name or `--color-*` reference that appears only in a documentation example
|
|
16
17
|
ships as real CSS -- the license's "contents" once shipped as
|
|
17
18
|
`.contents{display:contents}`.
|
|
18
19
|
`exports.test.ts` guards it. `scripts/build-tw.mjs` strips these lines from
|
|
19
|
-
the `
|
|
20
|
-
|
|
20
|
+
the `tw/` copy, where they have no job: the `/tw` consumer scans their own
|
|
21
|
+
tree. */
|
|
21
22
|
|
|
22
23
|
@import "./theme.css";
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
@import "./
|
|
26
|
-
@import "./
|
|
24
|
+
/* No `typography.css` here: `components/rules.css` brings its rules, and a
|
|
25
|
+
second route to a `@utility` stacks its body. */
|
|
26
|
+
@import "./utilities/rules.css";
|
|
27
|
+
@import "./components/rules.css";
|
|
28
|
+
@import "./reset.rules.css";
|
package/tw/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/tw/intent.css
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
/* The intent classes are `@utility` rules in `utilities.families`, so `@apply`
|
|
2
|
+
and Tailwind's variants reach them while every rule written straight into
|
|
3
|
+
`utilities` still beats them; the floor and the resets are plain rules in
|
|
4
|
+
`components`, below both. See docs/internal/model.md#cascade-layers. */
|
|
5
|
+
|
|
6
|
+
/* An intent maps one colour family onto seven shared slots and nothing else.
|
|
7
|
+
It does not cascade: the reset at the bottom redeclares the neutral defaults
|
|
8
|
+
at every component's own root, so a `.success` container cannot recolour a
|
|
9
|
+
nested destructive button while `.btn.success` still wins. Every intent writes
|
|
10
|
+
every slot, `--intent-fill-max` included -- omitting it inherits the reset's
|
|
11
|
+
neutral cap, and `tests/integration/registry.test.ts` fails the build on one
|
|
12
|
+
that does. Neutral maps `--intent-subtle` to `--color-surface` (the tone
|
|
13
|
+
tooltips, key caps, code and table heads sit on) and `--intent-border` to
|
|
14
|
+
`--ui-ink` (how an aesthetic restates the neutral line without naming one). */
|
|
15
|
+
|
|
16
|
+
/* The same neutral values, at the root. This is the floor: an element that
|
|
17
|
+
carries no intent class and matches none of the resets below -- a component
|
|
18
|
+
`@apply`-ed onto a selector the package does not name, a bare `<code>` with
|
|
19
|
+
no native stylesheet loaded -- still composes against a real colour instead
|
|
20
|
+
of an undefined one that collapses its `color-mix()` to nothing. It is not
|
|
21
|
+
the barrier. `.neutral` and both resets below still write these slots on the
|
|
22
|
+
element itself, which is a matching rule and so beats this inherited value --
|
|
23
|
+
that is what stops a `.success` container's intent reaching a component
|
|
24
|
+
nested under it. An intent class on the element beats both. Values track
|
|
25
|
+
`.neutral` slot for slot; `registry.test.ts` fails the build on drift.
|
|
26
|
+
|
|
27
|
+
Except `--intent-border`, which is left undeclared here. Neutral's line is
|
|
28
|
+
`--ui-ink`, which an aesthetic sets on its own class, never on `:root`, so
|
|
29
|
+
resolved here it was always the theme's grey: a bare `box` under
|
|
30
|
+
`.neobrutalism` drew a grey line and a grey slab beside a `.neutral`
|
|
31
|
+
sibling's black ink. Its readers -- `box`, `.quote`, `.data-table` -- fall
|
|
32
|
+
back to the same chain on the element instead. */
|
|
33
|
+
@layer components {
|
|
34
|
+
:root {
|
|
35
|
+
--intent-color: var(--color-text);
|
|
36
|
+
--intent-contrast: var(--color-text-contrast);
|
|
37
|
+
--intent-hover: var(--color-text-hover);
|
|
38
|
+
--intent-strong: var(--color-text-strong);
|
|
39
|
+
--intent-subtle: var(--color-surface);
|
|
40
|
+
--intent-fill-max: 20%;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Neutral stops its fill short: its colour is the page's ink, so a full fill is
|
|
45
|
+
a slab and `.neutral.solid` would be pixel-for-pixel `.primary.solid`. 20% is
|
|
46
|
+
chosen against `.soft`'s 12% -- a step past the tint, not a repeat.
|
|
47
|
+
`--intent-contrast` stays the page colour; a `.neutral.solid` badge's ink is
|
|
48
|
+
`box`'s question, answered by the same `--ui-fg-on-fill` cap. Pointing this
|
|
49
|
+
slot at `--color-text` renders a checked neutral checkbox black-on-black. */
|
|
50
|
+
@utility neutral {
|
|
51
|
+
@layer families {
|
|
52
|
+
--intent-color: var(--color-text);
|
|
53
|
+
--intent-contrast: var(--color-text-contrast);
|
|
54
|
+
--intent-hover: var(--color-text-hover);
|
|
55
|
+
--intent-strong: var(--color-text-strong);
|
|
56
|
+
--intent-subtle: var(--color-surface);
|
|
57
|
+
--intent-border: var(--ui-ink, var(--color-border));
|
|
58
|
+
--intent-fill-max: 20%;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@utility primary {
|
|
63
|
+
@layer families {
|
|
64
|
+
--intent-color: var(--color-primary);
|
|
65
|
+
--intent-contrast: var(--color-primary-contrast);
|
|
66
|
+
--intent-hover: var(--color-primary-hover);
|
|
67
|
+
--intent-strong: var(--color-primary-strong);
|
|
68
|
+
--intent-subtle: var(--color-primary-subtle);
|
|
69
|
+
--intent-border: var(--color-primary);
|
|
70
|
+
--intent-fill-max: 100%;
|
|
71
|
+
/* With more contrast asked for, an intent's line is its strong tone, in
|
|
72
|
+
this and every intent below. `box` fades a line by the fill under it, so
|
|
73
|
+
on a soft fill the resting tone drew at 2.4:1 for warning in light and
|
|
74
|
+
2.9:1 for success in dark. See docs/accessibility.md. */
|
|
75
|
+
@media (prefers-contrast: more) {
|
|
76
|
+
--intent-border: var(--color-primary-strong);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@utility secondary {
|
|
82
|
+
@layer families {
|
|
83
|
+
--intent-color: var(--color-accent);
|
|
84
|
+
--intent-contrast: var(--color-accent-contrast);
|
|
85
|
+
--intent-hover: var(--color-accent-hover);
|
|
86
|
+
--intent-strong: var(--color-accent-strong);
|
|
87
|
+
--intent-subtle: var(--color-accent-subtle);
|
|
88
|
+
--intent-border: var(--color-accent);
|
|
89
|
+
--intent-fill-max: 100%;
|
|
90
|
+
@media (prefers-contrast: more) {
|
|
91
|
+
--intent-border: var(--color-accent-strong);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@utility success {
|
|
97
|
+
@layer families {
|
|
98
|
+
--intent-color: var(--color-success);
|
|
99
|
+
--intent-contrast: var(--color-success-contrast);
|
|
100
|
+
--intent-hover: var(--color-success-hover);
|
|
101
|
+
--intent-strong: var(--color-success-strong);
|
|
102
|
+
--intent-subtle: var(--color-success-subtle);
|
|
103
|
+
--intent-border: var(--color-success);
|
|
104
|
+
--intent-fill-max: 100%;
|
|
105
|
+
@media (prefers-contrast: more) {
|
|
106
|
+
--intent-border: var(--color-success-strong);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@utility warning {
|
|
112
|
+
@layer families {
|
|
113
|
+
--intent-color: var(--color-warning);
|
|
114
|
+
--intent-contrast: var(--color-warning-contrast);
|
|
115
|
+
--intent-hover: var(--color-warning-hover);
|
|
116
|
+
--intent-strong: var(--color-warning-strong);
|
|
117
|
+
--intent-subtle: var(--color-warning-subtle);
|
|
118
|
+
--intent-border: var(--color-warning);
|
|
119
|
+
--intent-fill-max: 100%;
|
|
120
|
+
@media (prefers-contrast: more) {
|
|
121
|
+
--intent-border: var(--color-warning-strong);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@utility destructive {
|
|
127
|
+
@layer families {
|
|
128
|
+
--intent-color: var(--color-destructive);
|
|
129
|
+
--intent-contrast: var(--color-destructive-contrast);
|
|
130
|
+
--intent-hover: var(--color-destructive-hover);
|
|
131
|
+
--intent-strong: var(--color-destructive-strong);
|
|
132
|
+
--intent-subtle: var(--color-destructive-subtle);
|
|
133
|
+
--intent-border: var(--color-destructive);
|
|
134
|
+
--intent-fill-max: 100%;
|
|
135
|
+
@media (prefers-contrast: more) {
|
|
136
|
+
--intent-border: var(--color-destructive-strong);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@utility info {
|
|
142
|
+
@layer families {
|
|
143
|
+
--intent-color: var(--color-info);
|
|
144
|
+
--intent-contrast: var(--color-info-contrast);
|
|
145
|
+
--intent-hover: var(--color-info-hover);
|
|
146
|
+
--intent-strong: var(--color-info-strong);
|
|
147
|
+
--intent-subtle: var(--color-info-subtle);
|
|
148
|
+
--intent-border: var(--color-info);
|
|
149
|
+
--intent-fill-max: 100%;
|
|
150
|
+
@media (prefers-contrast: more) {
|
|
151
|
+
--intent-border: var(--color-info-strong);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* Every component resolves the neutral defaults at its own root, at zero
|
|
157
|
+
specificity, so an intent class on the element wins while an inherited value
|
|
158
|
+
loses -- the one rule that lets every component drop its per-intent branches.
|
|
159
|
+
This list and the one in `native.css` are the package's only hand-maintained
|
|
160
|
+
selector lists; `tests/integration/registry.test.ts` fails the build on a
|
|
161
|
+
registry component missing from either. `.text-control` and `.surface` are on
|
|
162
|
+
it though they are not components: both are documented as typeable on their
|
|
163
|
+
own, and a bare `<div class="surface">` with no intent resolved computes a
|
|
164
|
+
transparent background and a zero-width border -- `box` collapses. A
|
|
165
|
+
consumer's `@apply surface` or `@apply text-control` is not on it; each
|
|
166
|
+
utility carries its own copy for that element, excluding the classes here
|
|
167
|
+
that apply it, and `registry.test.ts` fails when that exclusion list drifts
|
|
168
|
+
from the classes that do. See docs/internal/model.md#what-apply-carries. */
|
|
169
|
+
@layer components {
|
|
170
|
+
:where(
|
|
171
|
+
.btn,
|
|
172
|
+
.ipt,
|
|
173
|
+
.text-control,
|
|
174
|
+
.surface,
|
|
175
|
+
.textarea,
|
|
176
|
+
.select,
|
|
177
|
+
.input-group,
|
|
178
|
+
.checkbox,
|
|
179
|
+
.radio,
|
|
180
|
+
.switch,
|
|
181
|
+
.card,
|
|
182
|
+
.panel,
|
|
183
|
+
.alert,
|
|
184
|
+
.data-table,
|
|
185
|
+
.pre,
|
|
186
|
+
.quote,
|
|
187
|
+
.tooltip-bubble,
|
|
188
|
+
.tooltip-icon,
|
|
189
|
+
.badge,
|
|
190
|
+
.kbd,
|
|
191
|
+
.code,
|
|
192
|
+
.skeleton,
|
|
193
|
+
.progress,
|
|
194
|
+
.divider
|
|
195
|
+
) {
|
|
196
|
+
--intent-color: var(--color-text);
|
|
197
|
+
--intent-contrast: var(--color-text-contrast);
|
|
198
|
+
--intent-hover: var(--color-text-hover);
|
|
199
|
+
--intent-strong: var(--color-text-strong);
|
|
200
|
+
--intent-subtle: var(--color-surface);
|
|
201
|
+
--intent-border: var(--ui-ink, var(--color-border));
|
|
202
|
+
--intent-fill-max: 20%;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* The six text controls take a heavier line than everything else that rests on
|
|
207
|
+
the shared neutral. A card, a table or a divider sits on a filled surface or
|
|
208
|
+
separates content that identifies itself; a text control at rest is a
|
|
209
|
+
transparent box whose only mark is its border, and WCAG 1.4.11 asks that
|
|
210
|
+
border for 3:1. `--color-border` gives it 1.42:1.
|
|
211
|
+
|
|
212
|
+
Declared here at zero specificity for the same reason the indicators below
|
|
213
|
+
are: written inside `@utility text-control` it would land in `utilities`,
|
|
214
|
+
above every intent class in `components`, and overrule `.primary` on the
|
|
215
|
+
element. Written as a plain class list it would carry 0-1-0 and, being later
|
|
216
|
+
in the stylesheet, beat `.primary` the same way. Either would make every
|
|
217
|
+
colored control draw a grey line; `:where()` keeps it under both. The copy
|
|
218
|
+
`text-control` carries for `@apply` does sit in `utilities`, and is safe
|
|
219
|
+
there only because it never matches an element with an intent class.
|
|
220
|
+
|
|
221
|
+
An aesthetic reaches this line through `--ui-control-ink` first, then its
|
|
222
|
+
`--ui-ink`: the theme keeps a control border apart from a surface border, and
|
|
223
|
+
an aesthetic whose neutral line suits a pane but not a control's boundary --
|
|
224
|
+
`.glass`'s white hairline, `.chunky-tile`'s tile grey -- names a control line
|
|
225
|
+
of its own. See docs/internal/model.md#presentation.
|
|
226
|
+
|
|
227
|
+
The second selector is the tooltip bubble's below, for the same reason:
|
|
228
|
+
`.neutral` carries 0-1-0 and beat `:where()`, so a `.neutral` field under
|
|
229
|
+
`.glass` drew the pane's hairline while an unclassed one drew the control
|
|
230
|
+
line, and writing the intent out changed the box. */
|
|
231
|
+
@layer components {
|
|
232
|
+
:where(.text-control, .ipt, .textarea, .select, .input-group, .checkbox, .radio, .switch) {
|
|
233
|
+
--intent-border: var(--ui-control-ink, var(--ui-ink, var(--color-control-border)));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* The `.neutral` arm sits beside the class it has to outrank, which is in
|
|
238
|
+
`utilities.families`; from `components` it would lose to it. */
|
|
239
|
+
@layer utilities.families {
|
|
240
|
+
:is(.text-control, .ipt, .textarea, .select, .input-group, .checkbox, .radio, .switch).neutral {
|
|
241
|
+
--intent-border: var(--ui-control-ink, var(--ui-ink, var(--color-control-border)));
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* A table's lines -- its frame, head rule, and row rules -- are drawn on a
|
|
246
|
+
plate, not at a pane's edge against the backdrop, so an aesthetic whose
|
|
247
|
+
neutral line is a highlight names a rule line of its own: glass's white
|
|
248
|
+
hairline vanishes on the table's light plate. Neutral only, and `.neutral`
|
|
249
|
+
included, the way the control line above is, and a `.neutral` row in a
|
|
250
|
+
table of another intent, which draws its rules as a neutral table does. */
|
|
251
|
+
@layer components {
|
|
252
|
+
:where(.data-table) {
|
|
253
|
+
--intent-border: var(--ui-rule-ink, var(--ui-ink, var(--color-border)));
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
@layer utilities.families {
|
|
258
|
+
:is(.data-table, .data-table tr).neutral {
|
|
259
|
+
--intent-border: var(--ui-rule-ink, var(--ui-ink, var(--color-border)));
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* The bubble a tooltip draws is the one plate in the package that is chosen
|
|
264
|
+
rather than composed, so it resolves the no-intent case onto its own pair
|
|
265
|
+
instead of the shared neutral -- see `--color-tooltip` in `theme.css`.
|
|
266
|
+
|
|
267
|
+
The cap goes with it. Neutral stops its fill at 20% because its colour is the
|
|
268
|
+
page's ink; `--color-tooltip` is a plate rather than an ink, so a full fill
|
|
269
|
+
of it is the plate and there is nothing to stop short of. `--intent-subtle`
|
|
270
|
+
stays the surface token, the tone every other unclassed component sits on.
|
|
271
|
+
`.tooltip-icon` is a separate element that never fills past `0%`, so the
|
|
272
|
+
generic neutral reset above is enough for it.
|
|
273
|
+
|
|
274
|
+
Two selectors, so `none` and `neutral` agree. `:where()` loses to any intent
|
|
275
|
+
class, so `.tooltip-bubble.primary` still floods with primary;
|
|
276
|
+
`.tooltip-bubble.neutral` carries 0-2-0 and beats `.neutral`, so writing the
|
|
277
|
+
intent out gives the same bubble as writing nothing. */
|
|
278
|
+
@layer components {
|
|
279
|
+
:where(.tooltip-bubble) {
|
|
280
|
+
--intent-color: var(--color-tooltip);
|
|
281
|
+
--intent-contrast: var(--color-tooltip-contrast);
|
|
282
|
+
--intent-hover: var(--color-tooltip);
|
|
283
|
+
--intent-strong: var(--color-tooltip-contrast);
|
|
284
|
+
--intent-subtle: var(--color-surface);
|
|
285
|
+
--intent-border: var(--ui-ink, var(--color-border));
|
|
286
|
+
--intent-fill-max: 100%;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
@layer utilities.families {
|
|
291
|
+
.neutral.tooltip-bubble {
|
|
292
|
+
--intent-color: var(--color-tooltip);
|
|
293
|
+
--intent-contrast: var(--color-tooltip-contrast);
|
|
294
|
+
--intent-hover: var(--color-tooltip);
|
|
295
|
+
--intent-strong: var(--color-tooltip-contrast);
|
|
296
|
+
--intent-subtle: var(--color-surface);
|
|
297
|
+
--intent-border: var(--ui-ink, var(--color-border));
|
|
298
|
+
--intent-fill-max: 100%;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/* Indicators take the color they sit in rather than the shared neutral, so a
|
|
303
|
+
skeleton inside filled or colored content still matches it. It has to be
|
|
304
|
+
declared here at zero specificity: written in the component's own block it
|
|
305
|
+
would carry 0-1-0 and, being later in the stylesheet, beat `.success` --
|
|
306
|
+
which silently makes every indicator ignore every intent class. */
|
|
307
|
+
@layer components {
|
|
308
|
+
:where(.skeleton, .progress, .divider) {
|
|
309
|
+
--intent-color: currentColor;
|
|
310
|
+
--intent-border: currentColor;
|
|
311
|
+
}
|
|
312
|
+
}
|
package/tw/modifiers.css
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/* The component modifiers: density, direction, width, padding, shape, and the
|
|
2
|
+
two progress states. Each is a utility in `utilities.families`, as the
|
|
3
|
+
classes in `presentation.css` are, so `@apply stack tight` and `md:tight`
|
|
4
|
+
work, and a consumer's component takes a modifier the way a shipped one
|
|
5
|
+
does.
|
|
6
|
+
|
|
7
|
+
A modifier cannot say what it changes, because each component answers it
|
|
8
|
+
with its own values -- `p-xs` is 0.5rem on a card and 0.25rem on a panel --
|
|
9
|
+
so it raises a flag and the component reads it, as `sm` and `lg` do in
|
|
10
|
+
`size.css`. The flag is a space toggle: unset it is guaranteed-invalid, so
|
|
11
|
+
`--_tight-gap: var(--_m-tight) 0.5rem` is invalid too and the
|
|
12
|
+
`var(--_tight-gap, ...)` that reads it takes its fallback; set, it is
|
|
13
|
+
empty, and the same line computes to `0.5rem`.
|
|
14
|
+
|
|
15
|
+
On an element that reads none of them a flag is a custom property nothing
|
|
16
|
+
uses, so a page's own `.active` or `.wide` class is not restyled by these.
|
|
17
|
+
|
|
18
|
+
The flags are not registered, unlike the size flags: a `@property` rule
|
|
19
|
+
ships in every build, used or not, and there are fifteen of these. They
|
|
20
|
+
inherit instead, and each component that reads one restates it `initial`
|
|
21
|
+
on itself at zero specificity -- see `--_m-` in the component files -- so a
|
|
22
|
+
`.card.p-xs` does not shrink the padding of a card inside it. See
|
|
23
|
+
docs/internal/model.md#modifiers. */
|
|
24
|
+
@utility tight {
|
|
25
|
+
@layer families {
|
|
26
|
+
--_m-tight: ;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@utility loose {
|
|
31
|
+
@layer families {
|
|
32
|
+
--_m-loose: ;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@utility vertical {
|
|
37
|
+
@layer families {
|
|
38
|
+
--_m-vertical: ;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@utility horizontal {
|
|
43
|
+
@layer families {
|
|
44
|
+
--_m-horizontal: ;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@utility between {
|
|
49
|
+
@layer families {
|
|
50
|
+
--_m-between: ;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@utility narrow {
|
|
55
|
+
@layer families {
|
|
56
|
+
--_m-narrow: ;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@utility wide {
|
|
61
|
+
@layer families {
|
|
62
|
+
--_m-wide: ;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@utility p-xs {
|
|
67
|
+
@layer families {
|
|
68
|
+
--_m-p-xs: ;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@utility p-sm {
|
|
73
|
+
@layer families {
|
|
74
|
+
--_m-p-sm: ;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@utility p-lg {
|
|
79
|
+
@layer families {
|
|
80
|
+
--_m-p-lg: ;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@utility flush {
|
|
85
|
+
@layer families {
|
|
86
|
+
--_m-flush: ;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@utility icon {
|
|
91
|
+
@layer families {
|
|
92
|
+
--_m-icon: ;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@utility pill {
|
|
97
|
+
@layer families {
|
|
98
|
+
--_m-pill: ;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@utility active {
|
|
103
|
+
@layer families {
|
|
104
|
+
--_m-active: ;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@utility indeterminate {
|
|
109
|
+
@layer families {
|
|
110
|
+
--_m-indeterminate: ;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Rules between a table's body rows, and no lines at all. These two write the
|
|
115
|
+
public token directly, as `edged` writes `--ui-border`: `--ui-rule` already
|
|
116
|
+
cascades, so the class on a container rules every table inside it. */
|
|
117
|
+
@utility ruled {
|
|
118
|
+
@layer families {
|
|
119
|
+
--ui-rule: 100%;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@utility ruleless {
|
|
124
|
+
@layer families {
|
|
125
|
+
--ui-rule: 0%;
|
|
126
|
+
}
|
|
127
|
+
}
|