@redseed/redseed-ui-tailwindcss 7.63.0 → 7.64.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/components/card.css +76 -0
- package/package.json +1 -1
package/components/card.css
CHANGED
|
@@ -153,6 +153,82 @@
|
|
|
153
153
|
@apply absolute inset-0 size-full pointer-events-none rounded-xl border-border-secondary;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
/* ── Category accent ──────────────────────────────────────────────────────────
|
|
157
|
+
A colour-coded edge for TAXONOMY, which the semantic variants above cannot
|
|
158
|
+
express: they say what state a card is in, not which category it belongs to.
|
|
159
|
+
|
|
160
|
+
Two deliberate choices:
|
|
161
|
+
|
|
162
|
+
1. It is a BORDER, not a pseudo-element. The card's ::before is already the
|
|
163
|
+
hover scrim and its ::after is free, but a border is what actually delivers
|
|
164
|
+
the behaviour the API promises — "the accent replaces that edge's border
|
|
165
|
+
rather than sitting alongside it". A border on that edge IS that edge's
|
|
166
|
+
border, so there is no double rule to suppress, it composes with `bordered`
|
|
167
|
+
for free (unbordered cards have 0-width edges, so only the accent paints),
|
|
168
|
+
and the content inset comes along with it instead of needing separate
|
|
169
|
+
padding. It also stays clear of the hover scrim and the action layer, both
|
|
170
|
+
of which are `absolute inset-0` and therefore resolve against the PADDING
|
|
171
|
+
box — so neither tints nor covers the accent.
|
|
172
|
+
|
|
173
|
+
2. Thickness is a token. On the ARC insights page the same "this card belongs
|
|
174
|
+
to domain X" idea was hand-rolled twice in one sitting at 4px and 3px,
|
|
175
|
+
because nothing told the author what the weight should be. 4px — the
|
|
176
|
+
heavier of the two — so the bar still reads as a category marker against
|
|
177
|
+
the 1px hairline on the card's other three edges.
|
|
178
|
+
|
|
179
|
+
These rules are (0,2,0) and sit AFTER the variant border rules on purpose.
|
|
180
|
+
`.rsui-card--bordered.rsui-card--draft` zeroes every border width and
|
|
181
|
+
`.rsui-card--bordered.rsui-card--ai-bold` makes every border colour
|
|
182
|
+
transparent, both at the same specificity; landing later lets the accent edge
|
|
183
|
+
survive on those two variants rather than being silently swallowed.
|
|
184
|
+
|
|
185
|
+
`left` maps to the INLINE-START edge, not the physical left, matching the
|
|
186
|
+
logical `padding-inline` this stylesheet already uses. The accent marks the
|
|
187
|
+
leading edge of the card, so it should follow writing direction. */
|
|
188
|
+
.rsui-card {
|
|
189
|
+
/* Neutral when the consumer supplies no `color`, so an accent edge is never
|
|
190
|
+
invisible. Same fallback token as Pill's resting accent. */
|
|
191
|
+
--rsui-card-accent: var(--color-background-secondary-contrast);
|
|
192
|
+
|
|
193
|
+
--rsui-card-accent-w: 0.25rem; /* space-xxs, 4px */
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.rsui-card.rsui-card--accent-left {
|
|
197
|
+
border-inline-start-style: solid;
|
|
198
|
+
border-inline-start-width: var(--rsui-card-accent-w);
|
|
199
|
+
border-inline-start-color: var(--rsui-card-accent);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.rsui-card.rsui-card--accent-top {
|
|
203
|
+
border-block-start-style: solid;
|
|
204
|
+
border-block-start-width: var(--rsui-card-accent-w);
|
|
205
|
+
border-block-start-color: var(--rsui-card-accent);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* Hold the accent clear of the action layer's ring.
|
|
209
|
+
|
|
210
|
+
The hover scrim and the action layer are both `absolute inset-0`, so they stop
|
|
211
|
+
at the padding box and cannot reach the border — but a RING is not bounded by
|
|
212
|
+
its element. `ring-2 ring-offset-2` paints `0 0 0 2px` of offset colour and
|
|
213
|
+
then `0 0 0 4px` of ring colour OUTWARD from the layer's border box, and a
|
|
214
|
+
child's box-shadow paints above its parent's border. Measured against this
|
|
215
|
+
accent that is a 4px band landing exactly on a 4px edge, so a `pressed` or
|
|
216
|
+
`current` card — or merely a focused one, since focus-visible uses the same
|
|
217
|
+
geometry — lost its category colour entirely at the moment it mattered most.
|
|
218
|
+
|
|
219
|
+
Pulling the layer in by the accent width on that edge puts the ring's outer
|
|
220
|
+
limit at the padding box, where the accent begins. Both then render: ring
|
|
221
|
+
around the content, accent around the card. Only the accented edge moves, so
|
|
222
|
+
every other card keeps the ring exactly where it was, and the 4px of click
|
|
223
|
+
area given up sits under a decorative bar. */
|
|
224
|
+
.rsui-card--accent-left .rsui-card__action-layer {
|
|
225
|
+
inset-inline-start: var(--rsui-card-accent-w);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.rsui-card--accent-top .rsui-card__action-layer {
|
|
229
|
+
inset-block-start: var(--rsui-card-accent-w);
|
|
230
|
+
}
|
|
231
|
+
|
|
156
232
|
/* Prevent table row hover background from bleeding past card rounded corners.
|
|
157
233
|
Opt out while a dropdown menu is open inside the card — otherwise the menu
|
|
158
234
|
gets clipped by the card's overflow boundary. */
|