@codenhub/styles 0.6.0 → 0.8.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/NOTICE +18 -16
- package/README.es.md +62 -0
- package/README.md +28 -22
- package/README.pt-BR.md +62 -0
- 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 +189 -0
- package/dist/components.css +2 -2
- package/dist/index.css +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/native.css +2 -2
- package/dist/palette.css +1 -1
- package/dist/theme.css +2 -2
- package/docs/accessibility.md +108 -60
- package/docs/changelog/0.1.1.md +1 -0
- package/docs/changelog/0.2.0.md +1 -0
- package/docs/changelog/0.3.0.md +1 -0
- package/docs/changelog/0.4.0.md +1 -0
- package/docs/changelog/0.5.0.md +8 -3
- package/docs/changelog/0.6.0.md +2 -1
- package/docs/changelog/0.7.0.md +50 -0
- package/docs/changelog/0.8.0.md +70 -0
- package/docs/changelog/index.md +2 -0
- package/docs/concepts.md +188 -46
- package/docs/es/accessibility.md +169 -0
- package/docs/es/concepts.md +212 -0
- package/docs/es/index.md +105 -0
- package/docs/es/integrating/astro.md +35 -0
- package/docs/es/integrating/index.md +75 -0
- package/docs/es/integrating/nextjs.md +67 -0
- package/docs/es/integrating/svelte.md +45 -0
- package/docs/es/integrating/tailwind.md +148 -0
- package/docs/es/integrating/vue.md +31 -0
- package/docs/es/integrating/without-a-bundler.md +238 -0
- package/docs/es/setup.md +188 -0
- package/docs/es/usage/aesthetics.md +282 -0
- package/docs/es/usage/buttons.md +135 -0
- package/docs/es/usage/composing.md +168 -0
- package/docs/es/usage/content-and-layout.md +219 -0
- package/docs/es/usage/customizing.md +304 -0
- package/docs/es/usage/feedback.md +157 -0
- package/docs/es/usage/forms.md +256 -0
- package/docs/es/usage/index.md +33 -0
- package/docs/es/usage/presets.md +92 -0
- package/docs/es/usage/solo.md +86 -0
- package/docs/es/usage/theming.md +309 -0
- package/docs/es/usage/tooltips.md +127 -0
- package/docs/index.md +86 -26
- package/docs/integrating/astro.md +3 -4
- package/docs/integrating/index.md +46 -13
- package/docs/integrating/nextjs.md +3 -4
- package/docs/integrating/svelte.md +5 -4
- package/docs/integrating/tailwind.md +89 -6
- package/docs/integrating/vue.md +3 -4
- package/docs/integrating/without-a-bundler.md +237 -0
- package/docs/pt-BR/accessibility.md +169 -0
- package/docs/pt-BR/concepts.md +212 -0
- package/docs/pt-BR/index.md +105 -0
- package/docs/pt-BR/integrating/astro.md +35 -0
- package/docs/pt-BR/integrating/index.md +75 -0
- package/docs/pt-BR/integrating/nextjs.md +67 -0
- package/docs/pt-BR/integrating/svelte.md +45 -0
- package/docs/pt-BR/integrating/tailwind.md +148 -0
- package/docs/pt-BR/integrating/vue.md +31 -0
- package/docs/pt-BR/integrating/without-a-bundler.md +238 -0
- package/docs/pt-BR/setup.md +188 -0
- package/docs/pt-BR/usage/aesthetics.md +282 -0
- package/docs/pt-BR/usage/buttons.md +135 -0
- package/docs/pt-BR/usage/composing.md +168 -0
- package/docs/pt-BR/usage/content-and-layout.md +219 -0
- package/docs/pt-BR/usage/customizing.md +304 -0
- package/docs/pt-BR/usage/feedback.md +157 -0
- package/docs/pt-BR/usage/forms.md +256 -0
- package/docs/pt-BR/usage/index.md +33 -0
- package/docs/pt-BR/usage/presets.md +92 -0
- package/docs/pt-BR/usage/solo.md +86 -0
- package/docs/pt-BR/usage/theming.md +309 -0
- package/docs/pt-BR/usage/tooltips.md +127 -0
- package/docs/setup.md +142 -91
- package/docs/usage/aesthetics.md +89 -73
- package/docs/usage/buttons.md +112 -40
- package/docs/usage/composing.md +109 -92
- package/docs/usage/content-and-layout.md +160 -125
- package/docs/usage/customizing.md +117 -41
- package/docs/usage/feedback.md +138 -71
- package/docs/usage/forms.md +201 -107
- package/docs/usage/index.md +22 -14
- package/docs/usage/presets.md +91 -0
- package/docs/usage/solo.md +85 -0
- package/docs/usage/theming.md +273 -118
- package/docs/usage/tooltips.md +90 -49
- package/llms-full.txt +2820 -1298
- package/llms.txt +24 -22
- package/package.json +134 -91
- package/{dist/tw → tw}/aesthetics/chunky-tile.css +107 -29
- package/{dist/tw → tw}/aesthetics/cyber.css +88 -40
- package/{dist/tw → tw}/aesthetics/glass.css +257 -61
- package/{dist/tw → tw}/aesthetics/neobrutalism.css +113 -20
- package/{dist/tw → tw}/aesthetics/pixel.css +93 -8
- package/tw/aesthetics/sketch.css +417 -0
- package/{dist/tw → tw}/box.css +105 -9
- 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} +136 -32
- package/tw/components/form.css +11 -0
- package/{dist/tw/components/form.css → tw/components/form.rules.css} +577 -125
- 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 +222 -0
- package/tw/components/tooltip.css +11 -0
- package/{dist/tw/components/tooltip.css → tw/components/tooltip.rules.css} +43 -27
- package/{dist/tw → tw}/corner.css +18 -12
- package/{dist/tw → tw}/elevation.css +23 -17
- package/{dist/tw → tw}/index.css +12 -10
- package/tw/index.d.ts +1 -0
- package/tw/intent.css +312 -0
- package/tw/modifiers.css +127 -0
- package/tw/native.css +320 -0
- package/tw/presentation.css +139 -0
- package/tw/reset.css +10 -0
- package/{dist/tw/reset.css → tw/reset.rules.css} +21 -22
- 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 +121 -45
- package/tw/typography.css +8 -0
- package/{dist/tw/typography.css → tw/typography.rules.css} +0 -3
- package/{dist/tw → tw}/utilities/content.css +212 -50
- package/tw/utilities/index.css +11 -0
- package/tw/utilities/layout.css +208 -0
- package/tw/utilities/rules.css +8 -0
- package/dist/tw/aesthetics/sketch.css +0 -333
- package/dist/tw/components/button.css +0 -139
- package/dist/tw/components/index.css +0 -36
- package/dist/tw/components/loader.css +0 -116
- package/dist/tw/components/surface.css +0 -175
- package/dist/tw/intent.css +0 -228
- 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 -130
- /package/{dist/tw → tw}/aesthetics/index.css +0 -0
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
@reference "tailwindcss";
|
|
2
|
-
@import "../theme.css";
|
|
3
|
-
@import "../surface.css";
|
|
4
|
-
@reference "../box.css";
|
|
5
|
-
|
|
6
|
-
/* A ghost, edged container that takes one unit when depth is supplied. */
|
|
7
|
-
@utility card {
|
|
8
|
-
@apply surface p-(--surface-padding,1.25rem);
|
|
9
|
-
|
|
10
|
-
/* After the `@apply`, not before: `surface` inlines its own resting geometry
|
|
11
|
-
at that point, so defaults written above it would be overridden by the very
|
|
12
|
-
utility they are meant to specialise. */
|
|
13
|
-
--_d-fill: 0%;
|
|
14
|
-
--_d-fg-on-fill: 0%;
|
|
15
|
-
--_d-border: 100%;
|
|
16
|
-
--_d-elevation: 1;
|
|
17
|
-
|
|
18
|
-
&.p-xs {
|
|
19
|
-
--surface-padding: 0.5rem;
|
|
20
|
-
--_scale-pad: 0.5;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&.p-sm {
|
|
24
|
-
--surface-padding: 0.75rem;
|
|
25
|
-
--_scale-pad: 0.75;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&.p-lg {
|
|
29
|
-
--surface-padding: 2rem;
|
|
30
|
-
--_scale-pad: 1.25;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&.flush {
|
|
34
|
-
--surface-padding: 0;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/* `.soft` rests untinted for no named intent instead of mixing its 12%: 12%
|
|
38
|
-
of `--color-text` onto any of `--color-background`, `--color-foreground`,
|
|
39
|
-
or `--color-surface` lands within a few units of the others (a near-black
|
|
40
|
-
ink dominates the result), so swapping the ground token alone does not read
|
|
41
|
-
as quieter. A resting no-intent `.card.soft` is `--color-foreground` with
|
|
42
|
-
no ink mixed in -- a plain step up from the page that marks a different
|
|
43
|
-
container without drawing attention to it.
|
|
44
|
-
|
|
45
|
-
A named intent keeps its ordinary 12% wash: 12% of an actual hue does not
|
|
46
|
-
read as a slab the way 12% of near-black ink does (`.card.soft.destructive`
|
|
47
|
-
is a gentle `249, 225, 225`), and untinting it would silence it rather than
|
|
48
|
-
quiet it. `:not(...)` names every intent class for that reason; `.panel`'s
|
|
49
|
-
carve-out below is scoped the same way.
|
|
50
|
-
|
|
51
|
-
`--_fill-cap: 0%` (box.css's override slot, not `--ui-fill` directly -- see
|
|
52
|
-
the comment there) composed with `box-hover`'s formula (`min(100%, resting
|
|
53
|
-
+ 14%)`) reveals the intent on hover with no second fill declaration for
|
|
54
|
-
the no-intent case: resting at 0% means hover lands at exactly the hover
|
|
55
|
-
step, 14%, in `--intent-hover`. The ground steps to `--color-surface` at
|
|
56
|
-
the same moment, through `--_d-surface-ground`, the default `surface` reads
|
|
57
|
-
beneath the public `--ui-surface-ground`, so a consumer's override, or
|
|
58
|
-
glass's ground, wins over both states. Scoped to `.interactive` and
|
|
59
|
-
`.hoverable`, the two classes that opt a card into `box-hover`: a plain
|
|
60
|
-
`.card.soft` has no hover state to reveal into and stays at the quiet rest.
|
|
61
|
-
A named intent needs neither special case: it rests tinted, so the generic
|
|
62
|
-
`box-hover` formula deepens it on hover (12% to 26%). */
|
|
63
|
-
&.soft:not(.primary, .secondary, .success, .warning, .destructive, .info) {
|
|
64
|
-
--_fill-cap: 0%;
|
|
65
|
-
--_d-surface-ground: var(--color-foreground);
|
|
66
|
-
|
|
67
|
-
&.interactive:hover,
|
|
68
|
-
&.hoverable:hover {
|
|
69
|
-
--_d-surface-ground: var(--color-surface);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/* Opt-in, because a card is only sometimes a control. Applications still owe
|
|
74
|
-
it a real interactive element and an accessible name. Hover and press are
|
|
75
|
-
the derived ones every other pressable box gets; there is nothing
|
|
76
|
-
card-specific about either.
|
|
77
|
-
|
|
78
|
-
`.interactive` is the whole opt-in and stays that way; `.hoverable` and
|
|
79
|
-
`.pressable` are its halves, for a card that answers one gesture and not
|
|
80
|
-
the other. A card with its own nested controls takes `.hoverable` for the
|
|
81
|
-
hover warmth without the press-scale that reads as "you activated the
|
|
82
|
-
card" when the click really landed on a nested button. `.hoverable` alone
|
|
83
|
-
does not set the pointer cursor: that travels with being a click target,
|
|
84
|
-
i.e. with `.pressable` / `.interactive`. */
|
|
85
|
-
&.interactive,
|
|
86
|
-
&.hoverable {
|
|
87
|
-
@apply box-hover;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
&.interactive,
|
|
91
|
-
&.pressable {
|
|
92
|
-
@apply box-active cursor-pointer;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/* A panel is the flush, unelevated sibling: sidebars, toolbars, and wells that
|
|
97
|
-
sit flat against the layout rather than floating above it. Soft and edgeless
|
|
98
|
-
is what makes it read as a well without drawing a line to say so. */
|
|
99
|
-
@utility panel {
|
|
100
|
-
@apply surface p-(--surface-padding,1rem);
|
|
101
|
-
|
|
102
|
-
--_d-fill: 12%;
|
|
103
|
-
--_d-fg-on-fill: 0%;
|
|
104
|
-
--_d-border: 0%;
|
|
105
|
-
--_d-elevation: 0;
|
|
106
|
-
|
|
107
|
-
&.p-xs {
|
|
108
|
-
--surface-padding: 0.25rem;
|
|
109
|
-
--_scale-pad: 0.5;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
&.p-sm {
|
|
113
|
-
--surface-padding: 0.5rem;
|
|
114
|
-
--_scale-pad: 0.75;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
&.p-lg {
|
|
118
|
-
--surface-padding: 1.5rem;
|
|
119
|
-
--_scale-pad: 1.25;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
&.flush {
|
|
123
|
-
--surface-padding: 0;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/* Neutral panels are the common case -- layout wells, sidebars, toolbars with
|
|
127
|
-
no named intent -- and 12% of `--color-text` (near-black) mixed onto the
|
|
128
|
-
page is far more assertive than 12% of a hue (`217, 217, 217` against a
|
|
129
|
-
`250, 250, 250` page): the same "neutral ink reads louder" effect
|
|
130
|
-
`.card.soft` answers, and the reason `--intent-fill-max` stops neutral's
|
|
131
|
-
fill short everywhere else.
|
|
132
|
-
|
|
133
|
-
Scoped to no named intent rather than untinted unconditionally, as
|
|
134
|
-
`data-table` is: a panel is not interactive, so there is no hover to reveal
|
|
135
|
-
a colored intent into, and it is edgeless by default, so the fill is the
|
|
136
|
-
only channel a `.primary` bulk-actions bar or a `.destructive` danger-zone
|
|
137
|
-
panel has to say what it is (a resting `.panel.destructive` is a gentle
|
|
138
|
-
`249, 225, 225` wash). `.card.soft` carries the same scoping. `:not(...)`
|
|
139
|
-
names every intent class, plus `.solid`/`.ghost` so an explicit
|
|
140
|
-
presentation on the element is never clamped to a cap it did not ask for --
|
|
141
|
-
the guard `data-table`'s `:not(.solid, .ghost)` also uses.
|
|
142
|
-
|
|
143
|
-
Grounds on `--color-foreground` through `--_d-surface-ground`, the default
|
|
144
|
-
`.card.soft` rests on, so a bare `.panel` rests at exactly the plate a
|
|
145
|
-
`.card.soft` does, and a consumer's `--ui-surface-ground` or glass's
|
|
146
|
-
translucent ground wins over it: a neutral panel under `.glass` is glass.
|
|
147
|
-
Permanent rather than hover-revealed: neither a panel nor `data-table` has
|
|
148
|
-
an interaction state to reveal a tint into. */
|
|
149
|
-
&:not(.primary, .secondary, .success, .warning, .destructive, .info, .solid, .ghost) {
|
|
150
|
-
--_fill-cap: 0%;
|
|
151
|
-
--_d-surface-ground: var(--color-foreground);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/* The user agent already promises both of these for a native `<dialog>` --
|
|
156
|
-
`dialog:not([open]) { display: none }` and a centred `margin: auto` on the
|
|
157
|
-
open box -- but both are user-agent origin, which loses to any author rule
|
|
158
|
-
at all. `.card`'s own `display: block` beats the first outright, so a
|
|
159
|
-
`<dialog class="card">` rendered open with no `open` attribute and no
|
|
160
|
-
`.showModal()` call, and a margin reset beats the second, so an opened one
|
|
161
|
-
pinned to the top-left. The registry has no dialog component, and these
|
|
162
|
-
three are the containers a consumer reaches for.
|
|
163
|
-
|
|
164
|
-
Here rather than in the reset, so every entrypoint that ships `.card` ships
|
|
165
|
-
the fix, `/components` included. Unlayered, because a behaviour override has
|
|
166
|
-
to win over any layered rule whatever its specificity, and scoped to the
|
|
167
|
-
package's own containers, so a dialog the package does not style keeps
|
|
168
|
-
whatever margin its author gives it. */
|
|
169
|
-
dialog:is(.card, .panel, .surface):not([open]) {
|
|
170
|
-
display: none;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
dialog:is(.card, .panel, .surface)[open] {
|
|
174
|
-
margin: auto;
|
|
175
|
-
}
|
package/dist/tw/intent.css
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
/* Imported into the `components` layer by `theme.css`, below every utility, so
|
|
2
|
-
a consumer's own utility or unlayered CSS beats these classes. See
|
|
3
|
-
docs/internal/model.md#cascade-layers. */
|
|
4
|
-
|
|
5
|
-
/* An intent maps one colour family onto seven shared slots and nothing else.
|
|
6
|
-
It does not cascade: the reset at the bottom redeclares the neutral defaults
|
|
7
|
-
at every component's own root, so a `.success` container cannot recolour a
|
|
8
|
-
nested destructive button while `.btn.success` still wins. Every intent writes
|
|
9
|
-
every slot, `--intent-fill-max` included -- omitting it inherits the reset's
|
|
10
|
-
neutral cap, and `tests/integration/registry.test.ts` fails the build on one
|
|
11
|
-
that does. Neutral maps `--intent-subtle` to `--color-surface` (the tone
|
|
12
|
-
tooltips, key caps, code and table heads sit on) and `--intent-border` to
|
|
13
|
-
`--ui-ink` (how an aesthetic restates the neutral line without naming one). */
|
|
14
|
-
|
|
15
|
-
/* The same neutral values, at the root. This is the floor: an element that
|
|
16
|
-
carries no intent class and matches none of the resets below -- a component
|
|
17
|
-
`@apply`-ed onto a selector the package does not name, a bare `<code>` with
|
|
18
|
-
no native stylesheet loaded -- still composes against a real colour instead
|
|
19
|
-
of an undefined one that collapses its `color-mix()` to nothing. It is not
|
|
20
|
-
the barrier. `.neutral` and both resets below still write these slots on the
|
|
21
|
-
element itself, which is a matching rule and so beats this inherited value --
|
|
22
|
-
that is what stops a `.success` container's intent reaching a component
|
|
23
|
-
nested under it. An intent class on the element beats both. Values track
|
|
24
|
-
`.neutral` slot for slot; `registry.test.ts` fails the build on drift. */
|
|
25
|
-
:root {
|
|
26
|
-
--intent-color: var(--color-text);
|
|
27
|
-
--intent-contrast: var(--color-text-contrast);
|
|
28
|
-
--intent-hover: var(--color-text-hover);
|
|
29
|
-
--intent-strong: var(--color-text-strong);
|
|
30
|
-
--intent-subtle: var(--color-surface);
|
|
31
|
-
--intent-border: var(--ui-ink, var(--color-border));
|
|
32
|
-
--intent-fill-max: 20%;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/* Neutral stops its fill short: its colour is the page's ink, so a full fill is
|
|
36
|
-
a slab and `.neutral.solid` would be pixel-for-pixel `.primary.solid`. 20% is
|
|
37
|
-
chosen against `.soft`'s 12% -- a step past the tint, not a repeat.
|
|
38
|
-
`--intent-contrast` stays the page colour; a `.neutral.solid` badge's ink is
|
|
39
|
-
`box`'s question, answered by the same `--ui-fg-on-fill` cap. Pointing this
|
|
40
|
-
slot at `--color-text` renders a checked neutral checkbox black-on-black. */
|
|
41
|
-
.neutral {
|
|
42
|
-
--intent-color: var(--color-text);
|
|
43
|
-
--intent-contrast: var(--color-text-contrast);
|
|
44
|
-
--intent-hover: var(--color-text-hover);
|
|
45
|
-
--intent-strong: var(--color-text-strong);
|
|
46
|
-
--intent-subtle: var(--color-surface);
|
|
47
|
-
--intent-border: var(--ui-ink, var(--color-border));
|
|
48
|
-
--intent-fill-max: 20%;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.primary {
|
|
52
|
-
--intent-color: var(--color-primary);
|
|
53
|
-
--intent-contrast: var(--color-primary-contrast);
|
|
54
|
-
--intent-hover: var(--color-primary-hover);
|
|
55
|
-
--intent-strong: var(--color-primary-strong);
|
|
56
|
-
--intent-subtle: var(--color-primary-subtle);
|
|
57
|
-
--intent-border: var(--color-primary);
|
|
58
|
-
--intent-fill-max: 100%;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.secondary {
|
|
62
|
-
--intent-color: var(--color-accent);
|
|
63
|
-
--intent-contrast: var(--color-accent-contrast);
|
|
64
|
-
--intent-hover: var(--color-accent-hover);
|
|
65
|
-
--intent-strong: var(--color-accent-strong);
|
|
66
|
-
--intent-subtle: var(--color-accent-subtle);
|
|
67
|
-
--intent-border: var(--color-accent);
|
|
68
|
-
--intent-fill-max: 100%;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.success {
|
|
72
|
-
--intent-color: var(--color-success);
|
|
73
|
-
--intent-contrast: var(--color-success-contrast);
|
|
74
|
-
--intent-hover: var(--color-success-hover);
|
|
75
|
-
--intent-strong: var(--color-success-strong);
|
|
76
|
-
--intent-subtle: var(--color-success-subtle);
|
|
77
|
-
--intent-border: var(--color-success);
|
|
78
|
-
--intent-fill-max: 100%;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.warning {
|
|
82
|
-
--intent-color: var(--color-warning);
|
|
83
|
-
--intent-contrast: var(--color-warning-contrast);
|
|
84
|
-
--intent-hover: var(--color-warning-hover);
|
|
85
|
-
--intent-strong: var(--color-warning-strong);
|
|
86
|
-
--intent-subtle: var(--color-warning-subtle);
|
|
87
|
-
--intent-border: var(--color-warning);
|
|
88
|
-
--intent-fill-max: 100%;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.destructive {
|
|
92
|
-
--intent-color: var(--color-destructive);
|
|
93
|
-
--intent-contrast: var(--color-destructive-contrast);
|
|
94
|
-
--intent-hover: var(--color-destructive-hover);
|
|
95
|
-
--intent-strong: var(--color-destructive-strong);
|
|
96
|
-
--intent-subtle: var(--color-destructive-subtle);
|
|
97
|
-
--intent-border: var(--color-destructive);
|
|
98
|
-
--intent-fill-max: 100%;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.info {
|
|
102
|
-
--intent-color: var(--color-info);
|
|
103
|
-
--intent-contrast: var(--color-info-contrast);
|
|
104
|
-
--intent-hover: var(--color-info-hover);
|
|
105
|
-
--intent-strong: var(--color-info-strong);
|
|
106
|
-
--intent-subtle: var(--color-info-subtle);
|
|
107
|
-
--intent-border: var(--color-info);
|
|
108
|
-
--intent-fill-max: 100%;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/* Every component resolves the neutral defaults at its own root, at zero
|
|
112
|
-
specificity, so an intent class on the element wins while an inherited value
|
|
113
|
-
loses -- the one rule that lets every component drop its per-intent branches.
|
|
114
|
-
This list and the one in `native.css` are the package's only hand-maintained
|
|
115
|
-
selector lists; `tests/integration/registry.test.ts` fails the build on a
|
|
116
|
-
registry component missing from either. `.text-control` and `.surface` are on
|
|
117
|
-
it though they are not components: both are documented as typeable on their
|
|
118
|
-
own, and a bare `<div class="surface">` with no intent resolved computes a
|
|
119
|
-
transparent background and a zero-width border -- `box` collapses. */
|
|
120
|
-
:where(
|
|
121
|
-
.btn,
|
|
122
|
-
.ipt,
|
|
123
|
-
.text-control,
|
|
124
|
-
.surface,
|
|
125
|
-
.textarea,
|
|
126
|
-
.select,
|
|
127
|
-
.input-group,
|
|
128
|
-
.checkbox,
|
|
129
|
-
.radio,
|
|
130
|
-
.switch,
|
|
131
|
-
.card,
|
|
132
|
-
.panel,
|
|
133
|
-
.alert,
|
|
134
|
-
.data-table,
|
|
135
|
-
.pre,
|
|
136
|
-
.quote,
|
|
137
|
-
.tooltip-bubble,
|
|
138
|
-
.tooltip-icon,
|
|
139
|
-
.badge,
|
|
140
|
-
.kbd,
|
|
141
|
-
.code,
|
|
142
|
-
.loader,
|
|
143
|
-
.skeleton,
|
|
144
|
-
.progress,
|
|
145
|
-
.divider
|
|
146
|
-
) {
|
|
147
|
-
--intent-color: var(--color-text);
|
|
148
|
-
--intent-contrast: var(--color-text-contrast);
|
|
149
|
-
--intent-hover: var(--color-text-hover);
|
|
150
|
-
--intent-strong: var(--color-text-strong);
|
|
151
|
-
--intent-subtle: var(--color-surface);
|
|
152
|
-
--intent-border: var(--ui-ink, var(--color-border));
|
|
153
|
-
--intent-fill-max: 20%;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/* The six text controls take a heavier line than everything else that rests on
|
|
157
|
-
the shared neutral. A card, a table or a divider sits on a filled surface or
|
|
158
|
-
separates content that identifies itself; a text control at rest is a
|
|
159
|
-
transparent box whose only mark is its border, and WCAG 1.4.11 asks that
|
|
160
|
-
border for 3:1. `--color-border` gives it 1.42:1.
|
|
161
|
-
|
|
162
|
-
Declared here at zero specificity for the same reason the indicators below
|
|
163
|
-
are: written inside `@utility text-control` it would land in `utilities`,
|
|
164
|
-
above every intent class in `components`, and overrule `.primary` on the
|
|
165
|
-
element. Written as a plain class list it would carry 0-1-0 and, being later
|
|
166
|
-
in the stylesheet, beat `.primary` the same way. Either would make every
|
|
167
|
-
colored control draw a grey line; `:where()` keeps it under both.
|
|
168
|
-
|
|
169
|
-
An aesthetic reaches this line through `--ui-control-ink` first, then its
|
|
170
|
-
`--ui-ink`: the theme keeps a control border apart from a surface border, and
|
|
171
|
-
an aesthetic whose neutral line suits a pane but not a control's boundary --
|
|
172
|
-
`.glass`'s white hairline, `.chunky-tile`'s tile grey -- names a control line
|
|
173
|
-
of its own. See docs/internal/model.md#presentation.
|
|
174
|
-
|
|
175
|
-
The second selector is the tooltip bubble's below, for the same reason:
|
|
176
|
-
`.neutral` carries 0-1-0 and beat `:where()`, so a `.neutral` field under
|
|
177
|
-
`.glass` drew the pane's hairline while an unclassed one drew the control
|
|
178
|
-
line, and writing the intent out changed the box. */
|
|
179
|
-
:where(.text-control, .ipt, .textarea, .select, .input-group, .checkbox, .radio, .switch),
|
|
180
|
-
:is(.text-control, .ipt, .textarea, .select, .input-group, .checkbox, .radio, .switch).neutral {
|
|
181
|
-
--intent-border: var(--ui-control-ink, var(--ui-ink, var(--color-control-border)));
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/* A table's lines -- its frame, head rule, and row rules -- are drawn on a
|
|
185
|
-
plate, not at a pane's edge against the backdrop, so an aesthetic whose
|
|
186
|
-
neutral line is a highlight names a rule line of its own: glass's white
|
|
187
|
-
hairline vanishes on the table's light plate. Neutral only, and `.neutral`
|
|
188
|
-
included, the way the control line above is. */
|
|
189
|
-
:where(.data-table),
|
|
190
|
-
.data-table.neutral {
|
|
191
|
-
--intent-border: var(--ui-rule-ink, var(--ui-ink, var(--color-border)));
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/* The bubble a tooltip draws is the one plate in the package that is chosen
|
|
195
|
-
rather than composed, so it resolves the no-intent case onto its own pair
|
|
196
|
-
instead of the shared neutral -- see `--color-tooltip` in `theme.css`.
|
|
197
|
-
|
|
198
|
-
The cap goes with it. Neutral stops its fill at 20% because its colour is the
|
|
199
|
-
page's ink; `--color-tooltip` is a plate rather than an ink, so a full fill
|
|
200
|
-
of it is the plate and there is nothing to stop short of. `--intent-subtle`
|
|
201
|
-
stays the surface token, the tone every other unclassed component sits on.
|
|
202
|
-
`.tooltip-icon` is a separate element that never fills past `0%`, so the
|
|
203
|
-
generic neutral reset above is enough for it.
|
|
204
|
-
|
|
205
|
-
Two selectors, so `none` and `neutral` agree. `:where()` loses to any intent
|
|
206
|
-
class, so `.tooltip-bubble.primary` still floods with primary;
|
|
207
|
-
`.tooltip-bubble.neutral` carries 0-2-0 and beats `.neutral`, so writing the
|
|
208
|
-
intent out gives the same bubble as writing nothing. */
|
|
209
|
-
:where(.tooltip-bubble),
|
|
210
|
-
.tooltip-bubble.neutral {
|
|
211
|
-
--intent-color: var(--color-tooltip);
|
|
212
|
-
--intent-contrast: var(--color-tooltip-contrast);
|
|
213
|
-
--intent-hover: var(--color-tooltip);
|
|
214
|
-
--intent-strong: var(--color-tooltip-contrast);
|
|
215
|
-
--intent-subtle: var(--color-surface);
|
|
216
|
-
--intent-border: var(--ui-ink, var(--color-border));
|
|
217
|
-
--intent-fill-max: 100%;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/* Indicators take the color they sit in rather than the shared neutral, so a
|
|
221
|
-
loader inside filled or colored content still matches it. It has to be
|
|
222
|
-
declared here at zero specificity: written in the component's own block it
|
|
223
|
-
would carry 0-1-0 and, being later in the stylesheet, beat `.success` --
|
|
224
|
-
which silently makes every indicator ignore every intent class. */
|
|
225
|
-
:where(.loader, .skeleton, .progress, .divider) {
|
|
226
|
-
--intent-color: currentColor;
|
|
227
|
-
--intent-border: currentColor;
|
|
228
|
-
}
|
package/dist/tw/native.css
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
/* The layer map, stated before any import uses a layer -- see `theme.css`. */
|
|
2
|
-
@layer theme, base, components, utilities;
|
|
3
|
-
|
|
4
|
-
@import "./theme.css";
|
|
5
|
-
@reference "tailwindcss";
|
|
6
|
-
/* Everything that is not `src/` -- see the note in `index.css`. Without the
|
|
7
|
-
docs and root-file excludes a utility used only in a documentation example
|
|
8
|
-
compiles into `dist/native.css`. */
|
|
9
|
-
@import "./typography.css";
|
|
10
|
-
@import "./utilities/index.css";
|
|
11
|
-
@import "./components/index.css";
|
|
12
|
-
@import "./reset.css";
|
|
13
|
-
|
|
14
|
-
@layer components {
|
|
15
|
-
/* `intent.css`'s reset keys on class names; these bare elements need the same,
|
|
16
|
-
or a `color-mix()` reading an undefined `--intent-*` drops silently. Zero
|
|
17
|
-
specificity like the class reset, values matching it slot for slot -- a bare
|
|
18
|
-
`<code>` and a `.code` chip are one component reached two ways. */
|
|
19
|
-
:where(table, kbd, code, pre, blockquote, hr, input, textarea, select, button) {
|
|
20
|
-
--intent-color: var(--color-text);
|
|
21
|
-
--intent-contrast: var(--color-text-contrast);
|
|
22
|
-
--intent-hover: var(--color-text-hover);
|
|
23
|
-
--intent-strong: var(--color-text-strong);
|
|
24
|
-
--intent-subtle: var(--color-surface);
|
|
25
|
-
--intent-border: var(--ui-ink, var(--color-border));
|
|
26
|
-
--intent-fill-max: 20%;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/* Native text controls and toggles take the same stronger neutral boundary as
|
|
30
|
-
their classed counterparts, without changing buttons or other inputs --
|
|
31
|
-
control ink included, as `intent.css`'s class reset reads it. */
|
|
32
|
-
:where(
|
|
33
|
-
input:not([type]),
|
|
34
|
-
input[type="checkbox"],
|
|
35
|
-
input[type="radio"],
|
|
36
|
-
input[type="text"],
|
|
37
|
-
input[type="number"],
|
|
38
|
-
input[type="email"],
|
|
39
|
-
input[type="password"],
|
|
40
|
-
input[type="url"],
|
|
41
|
-
input[type="tel"],
|
|
42
|
-
input[type="search"],
|
|
43
|
-
input[type="month"],
|
|
44
|
-
input[type="week"],
|
|
45
|
-
input[type="time"],
|
|
46
|
-
input[type="date"],
|
|
47
|
-
input[type="datetime-local"],
|
|
48
|
-
textarea,
|
|
49
|
-
select
|
|
50
|
-
) {
|
|
51
|
-
--intent-border: var(--ui-control-ink, var(--ui-ink, var(--color-control-border)));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/* A bare table's lines take the rule line, as `.data-table`'s do in
|
|
55
|
-
`intent.css`. */
|
|
56
|
-
:where(table) {
|
|
57
|
-
--intent-border: var(--ui-rule-ink, var(--ui-ink, var(--color-border)));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
:where(hr) {
|
|
61
|
-
--intent-color: currentColor;
|
|
62
|
-
--intent-border: currentColor;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@layer base {
|
|
67
|
-
/* The `h1`-`ol` margin reset lives in `reset.css`, imported above. */
|
|
68
|
-
|
|
69
|
-
/* Headings */
|
|
70
|
-
h1 {
|
|
71
|
-
@apply text-title-lg;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
h2 {
|
|
75
|
-
@apply text-title;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
h3 {
|
|
79
|
-
@apply text-title-sm;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
h4 {
|
|
83
|
-
@apply text-label-lg;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
h5,
|
|
87
|
-
h6 {
|
|
88
|
-
@apply text-label;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/* Links are left out: a link takes the text it sits in, so one inside a
|
|
92
|
-
heading stays heading-sized. */
|
|
93
|
-
p,
|
|
94
|
-
li {
|
|
95
|
-
@apply text-body;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/* Content */
|
|
99
|
-
table {
|
|
100
|
-
@apply data-table;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
kbd {
|
|
104
|
-
@apply kbd;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
blockquote {
|
|
108
|
-
@apply quote;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
q {
|
|
112
|
-
@apply quote-inline;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
code {
|
|
116
|
-
@apply code;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
pre {
|
|
120
|
-
@apply pre;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
pre code {
|
|
124
|
-
@apply bg-transparent p-0;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
hr {
|
|
128
|
-
@apply divider;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/* Form controls. Every text-like type maps onto `.ipt` for the shared chrome
|
|
132
|
-
and nothing else -- an icon is a wrapper composition (`.input-group`), not a
|
|
133
|
-
property of the type, so no type paints one. */
|
|
134
|
-
input:not([type]),
|
|
135
|
-
input[type="text"],
|
|
136
|
-
input[type="number"],
|
|
137
|
-
input[type="email"],
|
|
138
|
-
input[type="password"],
|
|
139
|
-
input[type="url"],
|
|
140
|
-
input[type="tel"],
|
|
141
|
-
input[type="search"],
|
|
142
|
-
input[type="month"],
|
|
143
|
-
input[type="week"],
|
|
144
|
-
input[type="time"],
|
|
145
|
-
input[type="date"],
|
|
146
|
-
input[type="datetime-local"] {
|
|
147
|
-
@apply ipt;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
textarea {
|
|
151
|
-
@apply textarea;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
select {
|
|
155
|
-
@apply select;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
input[type="checkbox"] {
|
|
159
|
-
@apply checkbox;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
input[type="radio"] {
|
|
163
|
-
@apply radio;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/* Buttons */
|
|
167
|
-
button,
|
|
168
|
-
input[type="button"],
|
|
169
|
-
input[type="submit"],
|
|
170
|
-
input[type="reset"] {
|
|
171
|
-
@apply btn;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
@media (forced-colors: active) {
|
|
176
|
-
input[type="checkbox"],
|
|
177
|
-
input[type="radio"] {
|
|
178
|
-
/* Keep these explicit system colors from being forced back to transparent. */
|
|
179
|
-
forced-color-adjust: none;
|
|
180
|
-
background-color: Canvas;
|
|
181
|
-
border-color: CanvasText;
|
|
182
|
-
transition: none;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
input[type="checkbox"]:checked,
|
|
186
|
-
input[type="checkbox"]:indeterminate {
|
|
187
|
-
background-color: Highlight;
|
|
188
|
-
border-color: Highlight;
|
|
189
|
-
|
|
190
|
-
&::after {
|
|
191
|
-
background-color: HighlightText;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
input[type="radio"]:checked {
|
|
196
|
-
background-color: Canvas;
|
|
197
|
-
border-color: Highlight;
|
|
198
|
-
|
|
199
|
-
&::after {
|
|
200
|
-
background-color: Highlight;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|