@splendidlabz/styles 4.14.0 → 4.16.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/catalog.md +200 -0
- package/package.json +2 -1
- package/scripts/spotlight.js +0 -1
- package/src/components/css/card.css +1 -1
- package/src/components/css/forms/combobox.css +154 -15
- package/src/components/css/forms/input.css +12 -0
- package/src/components/css/prose.css +7 -2
- package/src/components/css/table.css +2 -2
- package/src/components/svelte/tabs.css +2 -2
- package/src/layouts/macro/grid-flex.css +4 -4
- package/src/layouts/macro/section.css +1 -1
- package/src/layouts/micro/divider.css +1 -1
- package/src/layouts/micro/scrollable.css +2 -2
- package/src/reset.css +1 -1
- package/src/variables/variables.css +2 -2
package/catalog.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# @splendidlabz/styles catalog
|
|
2
|
+
|
|
3
|
+
This file lists every utility group `@splendidlabz/styles` ships for Tailwind CSS v4, the entry point that provides it, and when to reach for each utility. Find your job here and read the utility's docs or source before you use it. For components such as forms, modals, tabs, images and SEO, read `node_modules/@splendidlabz/svelte/catalog.md` and `node_modules/@splendidlabz/astro/catalog.md`. Write your own CSS only when none of them fits.
|
|
4
|
+
|
|
5
|
+
## Where to read a utility
|
|
6
|
+
|
|
7
|
+
- **Docs:** the layouts have pages at `https://splendidlabz.com/docs/layouts/<section>/<page>/`. Each layout heading below names its section, and each line names its page when it has one. Read [CSS variables](https://splendidlabz.com/docs/layouts/guides/css-variables/) and [Responsive layouts](https://splendidlabz.com/docs/layouts/guides/responsive-layouts/) before your first layout.
|
|
8
|
+
- **Source:** `node_modules/@splendidlabz/styles/src/`, for any utility without a docs page. The first line under each `##` heading names its folder there. Each layout subheading names its docs section, then its folder in `src/layouts/`.
|
|
9
|
+
|
|
10
|
+
## Entry points
|
|
11
|
+
|
|
12
|
+
Import `tailwindcss` first. Then import the full bundle alone, or a foundation followed by any component layer. A foundation is `base` or `utilities`. A component layer is `components/css`, `components/astro`, `components/svelte` or `components`.
|
|
13
|
+
|
|
14
|
+
- `@splendidlabz/styles`: the full bundle of reset, theme variables, bare-HTML styles, tools, layouts, effects and the CSS components.
|
|
15
|
+
- `@splendidlabz/styles/base`: the full bundle without the CSS components. Use it under `components/astro` or `components/svelte`.
|
|
16
|
+
- `@splendidlabz/styles/utilities`: tools, layouts, effects and `button`, with no reset and no bare-HTML styles. Use it in a project that keeps its own base styles.
|
|
17
|
+
- `@splendidlabz/styles/components/css`: the CSS components alone.
|
|
18
|
+
- `@splendidlabz/styles/components/astro`, `/components/svelte`: the CSS components plus the styles of `@splendidlabz/astro` or `@splendidlabz/svelte` components. `/components` carries both.
|
|
19
|
+
- `@splendidlabz/styles/layouts`, `/effects`: one group with the tools it needs, for a project that wants only that group.
|
|
20
|
+
- `@splendidlabz/styles/theming`: the theme variables and the tools.
|
|
21
|
+
- `@splendidlabz/styles/tools`, `/pigment`, `/variables`: the tools, pigment alone, or the theme variables alone.
|
|
22
|
+
- `@splendidlabz/styles/scripts`: the browser scripts listed at the end of this file.
|
|
23
|
+
|
|
24
|
+
Import `base` or `utilities`, never both. Import no component layer after the full bundle, since it already carries the CSS components. Tailwind doesn't dedupe a repeated `@import`, so either mistake ships the shared utilities twice.
|
|
25
|
+
|
|
26
|
+
## Layouts
|
|
27
|
+
|
|
28
|
+
In `layouts`, `base`, `utilities` and the full bundle. Source: `src/layouts/`.
|
|
29
|
+
|
|
30
|
+
### Rules
|
|
31
|
+
|
|
32
|
+
- Keep layout in the markup. Write your own CSS class only for a layout the whole site reuses.
|
|
33
|
+
- Set a utility's variables on its element with Tailwind arbitrary properties, such as `[--cols:3]`.
|
|
34
|
+
- Space children with a `gap-*` class on their parent. Give the children no outer margins.
|
|
35
|
+
- On `grid-flex`, set `--gap` instead of a `gap-*` class.
|
|
36
|
+
- On a parent whose nested layouts should share its gap, set `--gap` too.
|
|
37
|
+
|
|
38
|
+
### Page shell (`shell-layouts`, `shell/`)
|
|
39
|
+
|
|
40
|
+
- `shell-simple`: a vertical page whose content grows to fill the screen, so the footer sits at the bottom. Page: `shell-simple`.
|
|
41
|
+
- `shell-grid`, `shell-body`: a header, left sidebar, main area and right sidebar. The main area fills the space, and the sidebar widths are adjustable. Page: `shell-grid`.
|
|
42
|
+
|
|
43
|
+
### Page regions (`macro-layouts`, `macro/`)
|
|
44
|
+
|
|
45
|
+
- `wrap`: horizontal padding that keeps content off the screen's edges. Page: `wrap`.
|
|
46
|
+
- `section`: vertical padding around a page section, set by `--spacing-section`. No page.
|
|
47
|
+
- `section-mini`: a `section` with half the padding. No page.
|
|
48
|
+
- `section-cont`: a `section` that drops its top padding when it follows a `section` or another `section-cont`. No page.
|
|
49
|
+
- `grid-with-breakout`: a three-column grid whose items can break out of the main column. Page: `grid-with-breakout`.
|
|
50
|
+
|
|
51
|
+
### Grids (`macro-layouts`, `macro/`)
|
|
52
|
+
|
|
53
|
+
- `grid-simple`: `--cols` equal columns. Page: `grid-simple`.
|
|
54
|
+
- `grid-fr-auto`: columns that fill the space, then one column sized to its content. Page: `grid-fr-auto`.
|
|
55
|
+
- `grid-auto-fr`: one column sized to its content, then columns that fill the space. Page: `grid-auto-fr`.
|
|
56
|
+
- `grid-repeat-auto`: `--cols` columns, each sized to its content.
|
|
57
|
+
- `grid-gallery`, `grid-gallery-fill`, `grid-gallery-fit`: as many columns of `--item-width` as fit, by `auto-fill` (the first two) or `auto-fit`. Page: `grid-gallery`.
|
|
58
|
+
- `grid-flex`: `--cols` columns built with Flexbox. An item spans columns with `--span`, and the items in a short last row grow to fill it. Page: `grid-flex`.
|
|
59
|
+
- `grid-flex-gallery`: Flexbox items of at least `--item-width` that share each row.
|
|
60
|
+
- `grid-alternate`: two-column rows that swap sides in turn, starting from `data-start="left"` or `"right"`.
|
|
61
|
+
- `dense`, `dense-row`, `dense-column`: fill earlier gaps in a grid.
|
|
62
|
+
- `masonry`, `masonry-gallery`: a masonry grid by `--cols`, or by `--item-width`. Page: `masonry`.
|
|
63
|
+
- `subgrid`, `subgrid-columns`, `subgrid-rows`: children that line up with their parent's grid tracks. Page: `subgrid`.
|
|
64
|
+
|
|
65
|
+
### Inside a component (`micro-layouts`, `micro/`)
|
|
66
|
+
|
|
67
|
+
- `vertical`: children in a column. Page: `vertical`.
|
|
68
|
+
- `horizontal`: children in a row. Page: `horizontal`.
|
|
69
|
+
- `flow`: children in a row that wraps onto the next line. Page: `flow`.
|
|
70
|
+
- `stack`: children layered on top of each other. Page: `stack`.
|
|
71
|
+
- `stack-interactive`: a `stack` whose `.underlay` and `.overlay` children show on hover and focus. No page.
|
|
72
|
+
- `divider-x`, `divider-y`: a line that fills the space beside its content. `divider-horizontal` and `divider-vertical` are aliases. Page: `dividers`.
|
|
73
|
+
- `divider-between-x`, `divider-between-y`: lines between children. `divider-between-horizontal` and `divider-between-vertical` are aliases. Page: `dividers`.
|
|
74
|
+
- `breakout-*`, `breakout-x-*`, `breakout-y-*`, `breakout-t-*`, `breakout-b-*`, `breakout-l-*`, `breakout-r-*`: negative margins that pull an item out of its container's padding. Page: `breakout`.
|
|
75
|
+
- `im-*`, `im-x-*`, `im-y-*`: margin on every direct child. No page.
|
|
76
|
+
- `ip-*`, `ip-x-*`, `ip-y-*`: padding on every direct child. No page.
|
|
77
|
+
- `scrollable`, `scrollable-x`, `scrollable-y`: an overflowing area with scroll snap. `scrollable-horizontal` and `scrollable-vertical` are aliases; `scrollable-nosnap` and `snap-type-*` change the snap. Page: `scrollable`.
|
|
78
|
+
- `new-stacking-context`: a new stacking context. Page: `new-stacking-context`.
|
|
79
|
+
|
|
80
|
+
For a container-query context, use Tailwind's `@container`.
|
|
81
|
+
|
|
82
|
+
### Positioning (`positioning`, `position/`)
|
|
83
|
+
|
|
84
|
+
- `pos-*`: an element at a side, a corner, the centre or the whole area of a `stack` or `relative` parent: `top`, `topleft`, `topright`, `topfull`, `bottom`, `bottomleft`, `bottomright`, `bottomfull`, `left`, `leftfull`, `right`, `rightfull`, `center`, `overlay`. `stack-pos-*` and `relative-pos-*` force one parent type. Page: `position`.
|
|
85
|
+
- `edge-*`: an element that straddles a side or a corner of a `stack` or `relative` parent, with `-start` and `-end` variants for corners. `stack-edge-*` and `relative-edge-*` force one parent type, and `edge-adjust-*` sets the overlap alone. Page: `edge`.
|
|
86
|
+
- `fixed-*`: an element fixed to a side, a corner, the centre or the whole viewport. Page: `fixed`.
|
|
87
|
+
- `nudge`, `nudge-*`, `nudge-x-*`, `nudge-y-*`: move a `pos-*`, `edge-*` or `fixed-*` element in from its parent's edge. Page: `nudge`.
|
|
88
|
+
- `inner-radius`: the parent's `--radius` minus `--nudge`, for a nudged element.
|
|
89
|
+
- `sticky`, and the `sticking:` variant: `position: sticky`, and styles for while the element sticks. The `sticky` script sets the `.sticking` class. Page: `sticky`.
|
|
90
|
+
|
|
91
|
+
In the layout groups, the `*-scaffold` utilities and `micro` are the shared base of the utilities above. Apply them only when you build a new layout utility.
|
|
92
|
+
|
|
93
|
+
## Effects: shadows, gradients, highlights, borders, frosted glass, scrollbars and animations
|
|
94
|
+
|
|
95
|
+
In `effects`, `base`, `utilities` and the full bundle. Source: `src/effects/`.
|
|
96
|
+
|
|
97
|
+
- `shadow`, `inset`, `sx-*`, `sy-*`, `sb-*`, `ss-*`, `sc-*`, `sa-*`, and the `-sx-*`, `-sy-*`, `-ss-*`, `sxm-*`, `sym-*`, `sbm-*`, `ssm-*` variants: a box shadow built from x, y, blur, spread, colour and alpha.
|
|
98
|
+
- `text-shadow` with `ts*-*`, and `drop-shadow` with `ds*-*`: the same for text shadows and drop shadows.
|
|
99
|
+
- `shadow-before`, `shadow-after`, `shadow-pseudo`: a shadow on a pseudo-element that fades in by opacity.
|
|
100
|
+
- `elevation`, `elevation-1` to `elevation-7`, `ds-elevation-1` to `ds-elevation-7`: layered shadows for height, as box shadows or drop shadows.
|
|
101
|
+
- `gradient`, `linear-gradient`, `radial-gradient`, `conic-gradient`, the `repeating-*` versions, `gradient-angle-*` and `gradient-circle` or `gradient-ellipse`: gradient backgrounds that work with Tailwind's `from-*`, `via-*` and `to-*`.
|
|
102
|
+
- `text-gradient`, `gradient-text`: gradient-filled text.
|
|
103
|
+
- `fancybox`, `fancybox-bleed-border`, `fancybox-arrow`: a gradient border around a solid fill.
|
|
104
|
+
- `bezel`, `bezel-frost`, `bezel-arrow-*`, `inner-linear`, `inner-radial`, `inner-conic`, `outer-linear`, `outer-radial`, `outer-conic`: a bezel of inner and outer gradients.
|
|
105
|
+
- `spotlight`: a glow on a `bezel` that follows the pointer, driven by the `spotlight` script.
|
|
106
|
+
- `highlight`, `highlight-*`, `highlight-start-*`, `highlight-end-*`, `highlight-marker`, `highlight-marker-alt`, `highlight-tab`, `highlight-stamp`, `highlight-before`: a marker-pen highlight behind inline text.
|
|
107
|
+
- `frosted-glass`, `frosted-glass-advanced`: a blurred backdrop.
|
|
108
|
+
- `inner-border`: a border drawn inside the element.
|
|
109
|
+
- `scrollbar-thin`, `scrollbar-none`, `scrollbar-auto`, `scrollbar-thumb-*`, `scrollbar-track-*`, `scrollbars-on`: scrollbar size and colours.
|
|
110
|
+
- `text-stroke`: an outline around text. `text-outline` is deprecated.
|
|
111
|
+
- `animation`, `animation-fly`, `animation-fly-in-*`, `animation-fly-out-*`: keyframe animations in or out from a side.
|
|
112
|
+
- `fade`, `fly`, `fly-from-*`: an entry transition when the element appears, through `@starting-style`.
|
|
113
|
+
|
|
114
|
+
## Tools: state variants, pigment colours, transitions, outlines, radius and scaffolds
|
|
115
|
+
|
|
116
|
+
In every foundation, `theming`, `layouts`, `effects` and `tools`. Source: `src/tools/`.
|
|
117
|
+
|
|
118
|
+
- `interact:` and `interact-within:` variants: styles for hover, focus-visible, active, selected, checked, current, pressed and expanded states, on the element or anything inside it.
|
|
119
|
+
- `pigment`, `pigment-without-border`, `pigment-svg`, `pigment-with-svg`, `pigment-outline`, `pigment-ghost` (also in `/pigment`): colours that change by state, from `--bg-color`, `--text-color`, `--border-color` and their `-hover-`, `-focus-`, `-active-` and `-selected-` versions.
|
|
120
|
+
- `transition-scaffold`, `transition-scaffold-extended`, `transition-svg`: transitions on the common properties, timed by `--transition-duration`, `--transition-delay` and `--transition-easing`.
|
|
121
|
+
- `outline-scaffold`, `focus-within`, `preserve-outlines`: focus outlines from the `--outline-*` variables.
|
|
122
|
+
- `border-scaffold`, `padding-scaffold`, `margin-scaffold`: border, padding and margin from their variables.
|
|
123
|
+
- `rounded-*`, `rounded-t-*` and the other sides and corners: a radius on the spacing scale. `rounded-x`, `rounded-y`, `rounded-x-*` and `rounded-y-*` round only the first and last children.
|
|
124
|
+
- `radius-*`: set `--radius`, which cards, buttons and `inner-radius` read.
|
|
125
|
+
- `object-background`: an image or video that fills and covers its positioned parent.
|
|
126
|
+
- `--zalpha(color, alpha)`: a CSS function that returns a colour at an alpha.
|
|
127
|
+
|
|
128
|
+
## CSS components: buttons, cards, prose, headings, lists, tables, form fields, shapes and typography
|
|
129
|
+
|
|
130
|
+
In `components/css`, both component layers and the full bundle. `button` is also in `base` and `utilities`. Source: `src/components/css/`.
|
|
131
|
+
|
|
132
|
+
- `button`, `button-icon`, `button-round`: a button, an icon-only button, and a round one.
|
|
133
|
+
- `card`, `box`, `card-divided`, `card-divided-horizontal`, `card-divided-vertical`, `card-split`: a bordered padded card, and one with lines between its parts.
|
|
134
|
+
- `prose`, `prose-tight`, `prose-loose`: long-form text, spaced with a gap.
|
|
135
|
+
- `prose-div`: `prose` without flexbox.
|
|
136
|
+
- `hero-heading`, `hero-heading-start`, `hero-heading-center`, `hero-heading-end`: a large heading group, aligned.
|
|
137
|
+
- `indentlist`, `indentlist-guides`, `indentlist-singleguide`: nested lists indented by depth, with guide lines.
|
|
138
|
+
- `table-scaffold`, `table-auto`, `table-fixed`, `table-center`, `table-cell-defaults`, `table-header-row`, `table-header-column`, `table-radius`: a styled table.
|
|
139
|
+
- `input-container`, `input-group`: a text field, and fields or buttons joined in a row.
|
|
140
|
+
- `select`, `checkbox-and-radio`: a styled native select, and styled checkboxes and radios.
|
|
141
|
+
- `.combobox-options`: the option list of the Svelte `Select` and `Autocomplete`.
|
|
142
|
+
- `square`, `circle`, `roundrect`, `pill`: an element in that shape.
|
|
143
|
+
- `simple-svg`, `spl-fill-*`, `spl-stroke-*`: an SVG coloured by `--fill-color` and `--stroke-color`.
|
|
144
|
+
- `strikethrough`, `strike-*`, `strike-angle-*`: a line through text, at an angle.
|
|
145
|
+
- `writing-normal`, `writing-downwards`, `writing-downwards-lr`, `writing-downwards-rl`, `writing-rotate-left`, `writing-rotate-right`: vertical or rotated text. `writing-rotateleft` and `writing-rotateright` are aliases.
|
|
146
|
+
- `font-weight-[<n>]`: any weight, through a typed `--font-weight` that animates. For a weight on the theme scale, use Tailwind's `font-<n>`, such as `font-450`.
|
|
147
|
+
- `text-edge`: set `text-box-edge` to the cap height and the baseline, for use with `text-box-trim`.
|
|
148
|
+
- `font-position`: balance a font's vertical padding with `--font-position-adjust`.
|
|
149
|
+
- `base-anchor`, `text-relative`, `base-font-size`: sizes relative to `--base-size`, so a component scales with its own font size.
|
|
150
|
+
|
|
151
|
+
## Framework component styles
|
|
152
|
+
|
|
153
|
+
The components apply these classes themselves. Add only the variants marked opt-in, through the component's `class` prop.
|
|
154
|
+
|
|
155
|
+
- `components/svelte` (source `src/components/svelte/`) styles `@splendidlabz/svelte` components:
|
|
156
|
+
- `accordion`, `breadcrumbs`, `crumb`, `browserframe`, `callout`, `contentlist`, `drawer-content`, `.modal-content`, `[popover]`, `resizer`, `status` and `tablist`.
|
|
157
|
+
- Opt-in: `tablist-underline`, `tablist-card-divided`, `tablist-top`, `tablist-left`, `tablist-right` and `browserframe-colored`.
|
|
158
|
+
- `components/astro` (source `src/components/astro/`) styles the Astro `FancyList` (`fancylist`) and `Textwall` (`textwall`).
|
|
159
|
+
|
|
160
|
+
## Bare HTML
|
|
161
|
+
|
|
162
|
+
In `base` and the full bundle. Source: `src/generic/`, `src/reset.css`.
|
|
163
|
+
|
|
164
|
+
- Element styles:
|
|
165
|
+
- A reset, and `html` and `body` that fill the viewport.
|
|
166
|
+
- System fonts.
|
|
167
|
+
- Links styled with `pigment`, and buttons with `button`.
|
|
168
|
+
- Textareas that resize vertically.
|
|
169
|
+
- Smooth scrolling, and cross-page view transitions when the user allows motion.
|
|
170
|
+
- `.sr-only`: content for screen readers only.
|
|
171
|
+
- `.field`, `.form-field-helper`, `.disabled`, `.readonly`: a form field, its helper text, and its inactive states.
|
|
172
|
+
|
|
173
|
+
## Theme variables: type scale, font weights, breakpoints, radius, spacing and defaults
|
|
174
|
+
|
|
175
|
+
In `variables`, `theming`, `base` and the full bundle. Set them in your own `@theme` or on an element. Source: `src/variables/`.
|
|
176
|
+
|
|
177
|
+
- `--text-1` to `--text-22`: the type scale, from 10px to 120px, used as `text-1` to `text-22`. `--text-<n>e` is the same step in `em`, and `--text-<n>m` is it as a multiplier.
|
|
178
|
+
- `--font-weight-100` to `--font-weight-900`, in steps of 25: the weights for variable fonts, used as `font-100` to `font-900`.
|
|
179
|
+
- `bp1` to `bp25`, in 50px steps from 100px to 2500px: breakpoints for media queries (`bp8:`) and container queries (`@bp8:`).
|
|
180
|
+
- `--radius`: the default radius.
|
|
181
|
+
- `--radius-<n>`: a radius scale that `rounded-<n>` reads.
|
|
182
|
+
- `rounded-2` steps on `--spacing`.
|
|
183
|
+
- `rounded-1.5r` steps on `--radius`.
|
|
184
|
+
- `--gap`, `--padding`, `--leading`: default gap, padding and line height.
|
|
185
|
+
- `--border-width`, `--border-style`, `--border-color`, `--outline-width`, `--outline-style`, `--outline-focus-color`, `--outline-offset`.
|
|
186
|
+
- `--transition-duration`, `--transition-delay`, `--transition-easing`.
|
|
187
|
+
- `--spacing-section`: the padding of `section`, which `section-mini` halves.
|
|
188
|
+
- `--input-font`, `--textarea-height`, `--header-row-border-top`, `--header-row-border-bottom`, `--alt-row-color`, `--base-size`.
|
|
189
|
+
|
|
190
|
+
## Scripts
|
|
191
|
+
|
|
192
|
+
Import from `@splendidlabz/styles/scripts`, or one script from `@splendidlabz/styles/scripts/<name>`. Run them in the browser.
|
|
193
|
+
|
|
194
|
+
- `masonry(selector)`: lay out every `masonry` grid inside the selector.
|
|
195
|
+
- `scrollableHorizontal(selector)`: turn vertical wheel scrolling into horizontal scrolling on `.scrollable-prefer-horizontal`.
|
|
196
|
+
- `sticky(selector)`: set `.sticking` on `sticky` elements while they stick.
|
|
197
|
+
- `start()`, `stop()` (from `scripts/spotlight`): track the pointer for `spotlight`.
|
|
198
|
+
- `all(options)` (from `scripts/all`): run all four scripts. It takes an options object.
|
|
199
|
+
- Set `masonry`, `sticky`, `scrollable` or `spotlight` to `false` to skip that script.
|
|
200
|
+
- Set `element` to a selector or an element to limit the first three scripts to it. Without it, they search the whole page.
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splendidlabz/styles",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.16.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Elastic-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"homepage": "https://splendidlabz.com/docs/styles",
|
|
8
8
|
"author": "Zell Liew <zellwk@gmail.com>",
|
|
9
9
|
"files": [
|
|
10
|
+
"catalog.md",
|
|
10
11
|
"src",
|
|
11
12
|
"dist",
|
|
12
13
|
"scripts"
|
package/scripts/spotlight.js
CHANGED
|
@@ -1,40 +1,179 @@
|
|
|
1
|
-
.combobox-options {
|
|
1
|
+
:where(.combobox-options) {
|
|
2
2
|
padding: 0;
|
|
3
3
|
border: 0;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
max-height: var(--height);
|
|
6
|
+
:where(.combobox-options [role='listbox']) {
|
|
7
|
+
max-height: var(--options-max-height, 15rem);
|
|
8
|
+
margin: 0;
|
|
12
9
|
overflow-y: auto;
|
|
13
10
|
}
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
/* The end of every option keeps room for the check, so labels don't shift when it shows */
|
|
13
|
+
:where(.combobox-options [role='option']) {
|
|
14
|
+
position: relative;
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: var(--option-padding, 0.25lh 0.5lh);
|
|
17
|
+
padding-inline-end: 2.5em;
|
|
16
18
|
cursor: pointer;
|
|
17
19
|
}
|
|
18
20
|
|
|
21
|
+
/* The search status lines up with the options */
|
|
22
|
+
:where(.combobox-options .combobox-status) {
|
|
23
|
+
padding: var(--option-padding, 0.25lh 0.5lh);
|
|
24
|
+
}
|
|
25
|
+
|
|
19
26
|
/* Keeps the pointer cursor over an option's own markup */
|
|
20
|
-
.combobox-options [role='option'] > * {
|
|
27
|
+
:where(.combobox-options [role='option'] > *) {
|
|
21
28
|
pointer-events: none;
|
|
22
29
|
}
|
|
23
30
|
|
|
31
|
+
/* An option a full selection refuses. It stays in the list so the person can still read it. */
|
|
32
|
+
:where(.combobox-options [aria-disabled='true']) {
|
|
33
|
+
opacity: 0.4;
|
|
34
|
+
cursor: not-allowed;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* The selection — what was chosen. Comes before the band, so the band shows over the tint when both land on one option. Without --font-weight-selected, the weight stays inherited. */
|
|
38
|
+
:where(.combobox-options [aria-selected='true']) {
|
|
39
|
+
font-weight: var(--font-weight-selected);
|
|
40
|
+
background: var(
|
|
41
|
+
--bg-selected-color,
|
|
42
|
+
color-mix(in oklab, currentcolor 7%, transparent)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
24
46
|
/* The band — where the keyboard or pointer is. Defaults to the platform's own colors for the current item in a list. */
|
|
25
|
-
|
|
26
|
-
.combobox-options [
|
|
47
|
+
:where(
|
|
48
|
+
.combobox-options [data-highlighted],
|
|
49
|
+
.combobox-options [role='option']:focus
|
|
50
|
+
) {
|
|
27
51
|
color: var(--text-highlighted-color, HighlightText);
|
|
28
52
|
background: var(--bg-highlighted-color, Highlight);
|
|
29
53
|
}
|
|
30
54
|
|
|
31
|
-
/*
|
|
32
|
-
.combobox-options
|
|
33
|
-
|
|
55
|
+
/* prepareOptions copies the check into every option, and only a selected option shows it */
|
|
56
|
+
:where(.combobox-options .option-check) {
|
|
57
|
+
position: absolute;
|
|
58
|
+
inset-block: 0;
|
|
59
|
+
inset-inline-end: 0.75em;
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
visibility: hidden;
|
|
63
|
+
|
|
64
|
+
svg {
|
|
65
|
+
width: 1em;
|
|
66
|
+
height: 1em;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:where(.combobox-options [aria-selected='true'] .option-check) {
|
|
71
|
+
visibility: visible;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* The create option, shown while the typed text matches nothing */
|
|
75
|
+
:where(.combobox-options [data-create]) {
|
|
76
|
+
font-style: italic;
|
|
34
77
|
}
|
|
35
78
|
|
|
36
79
|
/* Highlight pseudo-elements only take properties that don't affect layout, so the match can be recoloured but never bolded. font-weight here is silently ignored. */
|
|
37
|
-
::highlight(
|
|
80
|
+
::highlight(match) {
|
|
38
81
|
color: var(--text-match-color, #7c3aed);
|
|
39
82
|
text-decoration: underline;
|
|
40
83
|
}
|
|
84
|
+
|
|
85
|
+
/* The chips and the input share one box, and wrap onto the next line once the row fills up */
|
|
86
|
+
:where(.combobox .input-group) {
|
|
87
|
+
@apply focus-within;
|
|
88
|
+
flex-wrap: wrap;
|
|
89
|
+
align-items: center;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Each chip joins the box's own row, so the field can sit after the last one */
|
|
93
|
+
:where(.combobox .chips) {
|
|
94
|
+
display: contents;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* With chips, the box holds the padding, so the chips and the field's text start at the same edge */
|
|
98
|
+
:where(.combobox .input-group:has(.chip)) {
|
|
99
|
+
gap: 0.25lh;
|
|
100
|
+
padding: var(--padding);
|
|
101
|
+
|
|
102
|
+
.input {
|
|
103
|
+
padding: 0;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* The field wraps to its own row once its placeholder or text no longer fits */
|
|
108
|
+
:where(.combobox .input-group .input) {
|
|
109
|
+
flex: 1 1 var(--field-min-width, max-content);
|
|
110
|
+
field-sizing: content;
|
|
111
|
+
min-width: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* The Select's button reads like a text field, with a caret at the end. The text's track has no minimum, so long text can't widen a container that sizes to its content. */
|
|
115
|
+
:where(.select-trigger) {
|
|
116
|
+
display: grid;
|
|
117
|
+
grid-template-columns: minmax(0, max-content) auto;
|
|
118
|
+
justify-content: space-between;
|
|
119
|
+
align-items: center;
|
|
120
|
+
gap: 0.5em;
|
|
121
|
+
text-align: start;
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
|
|
124
|
+
svg {
|
|
125
|
+
flex-shrink: 0;
|
|
126
|
+
width: 1em;
|
|
127
|
+
height: 1em;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* A long placeholder or label ends in an ellipsis instead of pushing the caret out */
|
|
132
|
+
:where(.select-trigger-text) {
|
|
133
|
+
overflow: hidden;
|
|
134
|
+
text-overflow: ellipsis;
|
|
135
|
+
white-space: nowrap;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:where(.select-placeholder) {
|
|
139
|
+
opacity: 0.5;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:where(.chips .chip) {
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
gap: 0.125em;
|
|
146
|
+
margin: 0;
|
|
147
|
+
padding-inline: 0.5em 0.125em;
|
|
148
|
+
border-radius: calc(var(--radius, 0.25rem) / 2);
|
|
149
|
+
color: var(--text-chip-color, inherit);
|
|
150
|
+
background: var(
|
|
151
|
+
--bg-chip-color,
|
|
152
|
+
color-mix(in oklab, currentcolor 10%, transparent)
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:where(.chips .chip-remove-button) {
|
|
157
|
+
display: grid;
|
|
158
|
+
place-items: center;
|
|
159
|
+
width: 1.25em;
|
|
160
|
+
height: 1.25em;
|
|
161
|
+
padding: 0;
|
|
162
|
+
border: 0;
|
|
163
|
+
border-radius: 50%;
|
|
164
|
+
color: inherit;
|
|
165
|
+
background: none;
|
|
166
|
+
opacity: 0.6;
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
|
|
169
|
+
svg {
|
|
170
|
+
width: 0.75em;
|
|
171
|
+
height: 0.75em;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&:hover,
|
|
175
|
+
&:focus-visible {
|
|
176
|
+
background: color-mix(in oklab, currentcolor 15%, transparent);
|
|
177
|
+
opacity: 1;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -55,3 +55,15 @@
|
|
|
55
55
|
.input-group.stack {
|
|
56
56
|
display: grid;
|
|
57
57
|
}
|
|
58
|
+
|
|
59
|
+
/* The replica sits under the textarea with the same text, so the stack grows with it */
|
|
60
|
+
.textarea-autogrow .replica-field {
|
|
61
|
+
visibility: hidden;
|
|
62
|
+
white-space: pre-wrap;
|
|
63
|
+
overflow-wrap: anywhere;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.textarea-autogrow textarea {
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
resize: none;
|
|
69
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
@utility prose {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-flow: column;
|
|
4
|
-
gap:
|
|
4
|
+
gap: 1em;
|
|
5
|
+
|
|
5
6
|
/* Inherits into descendants — Safari (only implementer) hangs decorative
|
|
6
7
|
* punctuation glyphs (e.g. a ::before quote mark) fully outside their box.
|
|
7
8
|
* Opt those out with hanging-punctuation: none. */
|
|
@@ -79,7 +80,11 @@
|
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
|
|
83
|
+
@utility prose-loose {
|
|
84
|
+
@apply prose;
|
|
85
|
+
gap: 1lh;
|
|
86
|
+
}
|
|
87
|
+
|
|
82
88
|
@utility prose-tight {
|
|
83
89
|
@apply prose;
|
|
84
|
-
gap: 1em;
|
|
85
90
|
}
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
/* Not named `table-cell` — Tailwind emits its own `table-cell` utility alongside a same-named `@utility` instead of replacing it, so every `@apply` would also set `display: table-cell`. */
|
|
48
48
|
@utility table-cell-defaults {
|
|
49
49
|
& {
|
|
50
|
-
padding-block: var(--cell-padding-y, 0.
|
|
51
|
-
padding-inline-end: var(--cell-padding-x, 0.
|
|
50
|
+
padding-block: var(--cell-padding-y, 0.5rem);
|
|
51
|
+
padding-inline-end: var(--cell-padding-x, 0.5rem);
|
|
52
52
|
text-align: left;
|
|
53
53
|
|
|
54
54
|
/* &:last-child {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
@utility tab {
|
|
7
7
|
align-items: start;
|
|
8
|
-
padding: 0.
|
|
8
|
+
padding: 0.25rem 0.5rem;
|
|
9
9
|
text-align: left;
|
|
10
10
|
|
|
11
11
|
&[aria-selected] {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
@utility tabpanel {
|
|
22
22
|
:where(&) {
|
|
23
|
-
padding:
|
|
23
|
+
padding: 1rem;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
--_cols: var(--cols);
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-flow: row wrap;
|
|
5
|
-
gap: var(--gap,
|
|
5
|
+
gap: var(--gap, 1rem);
|
|
6
6
|
width: 100%;
|
|
7
7
|
|
|
8
8
|
> *,
|
|
9
9
|
> *:where(astro-island, astro-slot) > *,
|
|
10
10
|
> :where(.contents) > * {
|
|
11
|
-
--one-column: var(--gap,
|
|
11
|
+
--one-column: var(--gap, 1rem) * (var(--_cols, 1) - 1);
|
|
12
12
|
flex: var(--grow, var(--span, 1)) var(--span, 1)
|
|
13
13
|
calc(
|
|
14
14
|
(100% - var(--one-column)) / var(--_cols, 1) * var(--span, 1) +
|
|
15
|
-
(var(--span, 1) - 1) * var(--gap,
|
|
15
|
+
(var(--span, 1) - 1) * var(--gap, 1rem)
|
|
16
16
|
);
|
|
17
17
|
min-width: min(100%, var(--item-width, 3rem));
|
|
18
18
|
max-width: 100%;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
& {
|
|
24
24
|
display: flex;
|
|
25
25
|
flex-flow: row wrap;
|
|
26
|
-
gap: var(--gap,
|
|
26
|
+
gap: var(--gap, 1rem);
|
|
27
27
|
width: 100%;
|
|
28
28
|
|
|
29
29
|
> * {
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
--snap-align: start;
|
|
3
3
|
--snap-type: proximity;
|
|
4
4
|
|
|
5
|
-
/* --scroll-margin:
|
|
5
|
+
/* --scroll-margin: 1rem; */
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
@utility scrollable {
|
|
9
9
|
& {
|
|
10
10
|
display: flex;
|
|
11
|
-
gap: var(--gap,
|
|
11
|
+
gap: var(--gap, 1rem);
|
|
12
12
|
|
|
13
13
|
> :where(*) {
|
|
14
14
|
flex-grow: 0;
|
package/src/reset.css
CHANGED