mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## Problem - on kb topic pages the guide row text is misaligned vs tab title - community guide row shows the favicon and the author before the title leading to inconsistence when among other list items - kb guide list and the docs code tabs each keep a copy of the folder tab indicator ## Solution - extracts the folder tab indicator to `ui` + the curve variables to the shared tailwind config - changes the tab corner to follow the active tab because chrome does not update a `:has()` rule on the tabs root - fixes the square corner + the background flash on the active kb tab before hydration - changes the kb guide rows to align with the tab labels + adds padding to the tabs and the row hover - moves the community favicon and author after the title | before | after | | -------|------| | <img width="2304" height="1533" alt="image" src="https://github.com/user-attachments/assets/585a1b1c-0314-4708-818c-69b324028d18" /> | <img width="2304" height="1517" alt="image" src="https://github.com/user-attachments/assets/5eb9614f-1873-42ed-86f4-1f7c8fa5e4f6" /> | <!-- ## Preview links If relevant, include links to changed pages for easy review access. Copy the preview base URL from the Vercel bot comment on this PR. Use the following table as an example template. | Site | Live | Preview | Search for | | -------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------- | | WWW | [/blog/your-post](https://supabase.com/blog/your-post) | [/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post) | unique phrase from the change | | Docs | [/docs/guides/your-page](https://supabase.com/docs/guides/your-page) | [/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page) | unique phrase from the change | | Studio | [/dashboard](https://supabase.com/dashboard) | [/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard) | unique phrase from the change | | Design system | [/design-system](https://supabase.com/design-system) | [/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system) | unique phrase from the change | | UI library | [/library](https://supabase.com/library) | [/library](https://ui-library-git-branch-name-supabase.vercel.app/library) | unique phrase from the change | | Knowledge base | [/kb/guides/your-page](https://supabase.com/kb/guides/your-page) | [/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page) | unique phrase from the change | --> <!-- ## Additional context Optionally add any other context or screenshots. --> ## Review instructions 1. open the live and preview [/kb/topics/database](https://kb-git-antlio-kb-guide-tabs-supabase.vercel.app/kb/topics/database) 2. make sure that the row titles start at the same position as the "All" tab label ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: alexisintech <98043211+alexisintech@users.noreply.github.com>
441 lines
12 KiB
CSS
441 lines
12 KiB
CSS
/*
|
|
* Custom Tailwind v4 utilities migrated from packages/config/ui.config.js
|
|
* (addUtilities + matchUtilities) and packages/config/tailwind.config.js
|
|
* (the .bg legacy shim).
|
|
*/
|
|
|
|
/*
|
|
* The `bg` class worked in Tailwind v3 but stopped working in v4. Restored as
|
|
* an alias for `bg-default` to avoid a wide rename across the codebase.
|
|
* Should be deprecated in favor of `bg-default`.
|
|
*/
|
|
@utility bg {
|
|
background-color: var(--background);
|
|
}
|
|
|
|
/* Contrast 0.5 produces (0.05 + 0.95 * 0.5)² = 0.275625. */
|
|
@utility control-surface-shadows {
|
|
--button-shadow-opacity: 0.04;
|
|
--button-edge-strength: calc(var(--contrast-border, 0.275625) / 0.275625 * 0.6);
|
|
--button-edge-color: var(--colors-black);
|
|
--button-shadow-drop: 0 1px 3px 0 hsl(var(--colors-black) / var(--button-shadow-opacity));
|
|
--button-shadow-raised:
|
|
var(--button-shadow-drop),
|
|
inset 0 1px 0 0 hsl(var(--button-edge-color) / calc(0.04 * var(--button-edge-strength))),
|
|
inset 0 0 0 1px hsl(var(--button-edge-color) / calc(0.06 * var(--button-edge-strength))),
|
|
inset 0 0 0 1px hsl(var(--button-edge-color) / calc(0.1 * var(--button-edge-strength)));
|
|
--button-edge-default:
|
|
inset 0 1px 0 0 hsl(var(--button-edge-color) / calc(0.04 * var(--button-edge-strength))),
|
|
inset 0 0 0 1px hsl(var(--colors-black) / calc(0.06 * var(--button-edge-strength))),
|
|
inset 0 -1px 0 0 hsl(var(--colors-black) / calc(0.06 * var(--button-edge-strength))),
|
|
inset 0 0 0 1px hsl(var(--button-edge-color) / calc(0.1 * var(--button-edge-strength)));
|
|
--button-shadow-default: var(--button-shadow-drop), var(--button-edge-default);
|
|
|
|
@variant dark {
|
|
--button-shadow-opacity: 0.2;
|
|
--button-edge-strength: calc(var(--contrast-border, 0.275625) / 0.275625);
|
|
--button-edge-color: var(--colors-white);
|
|
}
|
|
}
|
|
|
|
@utility raised-control-group {
|
|
& > .raised-control-surface {
|
|
--button-shadow-default: var(--button-shadow-drop);
|
|
border-color: transparent;
|
|
|
|
&::after {
|
|
content: '';
|
|
position: absolute;
|
|
inset: 0;
|
|
border-radius: inherit;
|
|
box-shadow: var(--button-edge-default);
|
|
pointer-events: none;
|
|
}
|
|
|
|
&:focus-visible {
|
|
z-index: 10;
|
|
}
|
|
}
|
|
|
|
& > .raised-control-surface:has(~ .raised-control-surface) {
|
|
border-top-right-radius: 0;
|
|
border-bottom-right-radius: 0;
|
|
border-right-width: 1px;
|
|
background-clip: padding-box;
|
|
overflow-x: clip;
|
|
|
|
/* the edge ends 2px past the border, so the clip removes its end side at any pixel snap */
|
|
&::after {
|
|
right: -3px;
|
|
}
|
|
|
|
&:focus-visible {
|
|
border-top-right-radius: var(--radius-sm);
|
|
border-bottom-right-radius: var(--radius-sm);
|
|
}
|
|
|
|
&:hover {
|
|
background-clip: border-box;
|
|
overflow-x: visible;
|
|
|
|
&::after {
|
|
right: -1px;
|
|
}
|
|
}
|
|
|
|
&:hover ~ .raised-control-surface {
|
|
background-clip: padding-box;
|
|
overflow-x: clip;
|
|
|
|
&::after {
|
|
left: -3px;
|
|
}
|
|
}
|
|
}
|
|
|
|
& > .raised-control-surface ~ .raised-control-surface {
|
|
margin-left: -1px;
|
|
border-top-left-radius: 0;
|
|
border-bottom-left-radius: 0;
|
|
border-left-width: 1px;
|
|
|
|
&::after {
|
|
left: -1px;
|
|
}
|
|
|
|
&:focus-visible {
|
|
border-top-left-radius: var(--radius-sm);
|
|
border-bottom-left-radius: var(--radius-sm);
|
|
}
|
|
}
|
|
}
|
|
|
|
@utility raised-control-surface {
|
|
@apply text-foreground bg-card shadow-[var(--button-shadow-default)];
|
|
|
|
@variant hover {
|
|
@apply bg-muted;
|
|
}
|
|
|
|
&[data-state='open'] {
|
|
@apply bg-muted;
|
|
}
|
|
|
|
@variant dark {
|
|
@apply bg-muted;
|
|
background-image: linear-gradient(
|
|
to bottom,
|
|
hsl(var(--colors-white) / 0.015),
|
|
hsl(var(--colors-black) / 0.01)
|
|
);
|
|
|
|
@variant hover {
|
|
@apply bg-accent;
|
|
}
|
|
|
|
&[data-state='open'] {
|
|
@apply bg-accent;
|
|
}
|
|
}
|
|
}
|
|
|
|
@utility raised-svg-surface {
|
|
& stop:first-child {
|
|
stop-color: hsl(var(--colors-white) / 0.015);
|
|
}
|
|
& stop:last-child {
|
|
stop-color: hsl(var(--colors-black) / 0.01);
|
|
}
|
|
& feDropShadow {
|
|
flood-color: hsl(var(--colors-black) / var(--button-shadow-opacity));
|
|
}
|
|
& [data-raised-edge] {
|
|
stroke: hsl(var(--button-edge-color) / calc(0.1 * var(--button-edge-strength)));
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Soft shimmer gradient used by LoadingLine.
|
|
*/
|
|
@utility line-loading-bg {
|
|
background: rgb(0, 0, 0);
|
|
background: linear-gradient(
|
|
90deg,
|
|
rgba(0, 0, 0, 0) 0%,
|
|
rgba(255, 255, 255, 0.65) 50%,
|
|
rgba(0, 0, 0, 0) 100%
|
|
);
|
|
}
|
|
@utility line-loading-bg-light {
|
|
background: rgb(0, 0, 0);
|
|
background: linear-gradient(
|
|
90deg,
|
|
rgba(0, 0, 0, 0) 0%,
|
|
rgba(33, 33, 33, 0.65) 50%,
|
|
rgba(0, 0, 0, 0) 100%
|
|
);
|
|
}
|
|
|
|
/* may be unused — verify before pruning */
|
|
@utility mask-fadeout-right {
|
|
-webkit-mask-image: linear-gradient(to right, white 98%, transparent 100%);
|
|
mask-image: linear-gradient(to right, white 98%, transparent 100%);
|
|
}
|
|
/* may be unused — verify before pruning */
|
|
@utility mask-fadeout-left {
|
|
-webkit-mask-image: linear-gradient(to left, white 98%, transparent 100%);
|
|
mask-image: linear-gradient(to left, white 98%, transparent 100%);
|
|
}
|
|
|
|
/*
|
|
* Fades the left or right edge of a horizontal scroll area when more content is on that side
|
|
*/
|
|
@property --scroll-fade-start {
|
|
syntax: '<length>';
|
|
initial-value: 0px;
|
|
inherits: false;
|
|
}
|
|
|
|
@property --scroll-fade-end {
|
|
syntax: '<length>';
|
|
initial-value: 0px;
|
|
inherits: false;
|
|
}
|
|
|
|
/* each fade changes size over the first or last 48px of the scroll */
|
|
@keyframes scroll-fade-start {
|
|
from {
|
|
--scroll-fade-start: 0px;
|
|
}
|
|
to {
|
|
--scroll-fade-start: 32px;
|
|
}
|
|
}
|
|
|
|
@keyframes scroll-fade-end {
|
|
from {
|
|
--scroll-fade-end: 32px;
|
|
}
|
|
to {
|
|
--scroll-fade-end: 0px;
|
|
}
|
|
}
|
|
|
|
@utility scroll-fade-x {
|
|
--scroll-shadow: rgb(0 0 0 / 0.05);
|
|
background:
|
|
linear-gradient(to right, var(--background) 40%, transparent) left / 40px 100% local,
|
|
linear-gradient(to left, var(--background) 40%, transparent) right / 40px 100% local,
|
|
linear-gradient(to right, var(--scroll-shadow), transparent) left / 24px 100% scroll,
|
|
linear-gradient(to left, var(--scroll-shadow), transparent) right / 24px 100% scroll;
|
|
background-repeat: no-repeat;
|
|
|
|
@variant dark {
|
|
--scroll-shadow: rgb(0 0 0 / 0.2);
|
|
}
|
|
|
|
@supports (animation-timeline: scroll()) {
|
|
background: none;
|
|
mask-image: linear-gradient(
|
|
to right,
|
|
transparent 0,
|
|
rgb(0 0 0 / 0.15) calc(var(--scroll-fade-start) * 0.25),
|
|
rgb(0 0 0 / 0.5) calc(var(--scroll-fade-start) * 0.5),
|
|
rgb(0 0 0 / 0.85) calc(var(--scroll-fade-start) * 0.75),
|
|
#000 var(--scroll-fade-start),
|
|
#000 calc(100% - var(--scroll-fade-end)),
|
|
rgb(0 0 0 / 0.85) calc(100% - var(--scroll-fade-end) * 0.75),
|
|
rgb(0 0 0 / 0.5) calc(100% - var(--scroll-fade-end) * 0.5),
|
|
rgb(0 0 0 / 0.15) calc(100% - var(--scroll-fade-end) * 0.25),
|
|
transparent 100%
|
|
);
|
|
/* use longhands. the kb build merges the shorthand and the timeline, and browsers reject the result */
|
|
animation-name: scroll-fade-start, scroll-fade-end;
|
|
animation-timing-function: linear;
|
|
animation-fill-mode: both;
|
|
animation-timeline: scroll(self inline);
|
|
animation-range:
|
|
0 48px,
|
|
calc(100% - 48px) 100%;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Functional color utilities. The `--value(--color-*)` token accepts any
|
|
* registered --color-* design token (e.g. highlight-foreground-light).
|
|
*/
|
|
/* may be unused — verify before pruning */
|
|
@utility highlight-* {
|
|
box-shadow: inset 0 1px 0 0 --value(--color-*);
|
|
}
|
|
/* may be unused — verify before pruning */
|
|
@utility subhighlight-* {
|
|
box-shadow: inset 0 -1px 0 0 --value(--color-*);
|
|
}
|
|
|
|
/*
|
|
* Inline-SVG grid background. Used by ProjectLinker as bg-grid-black/5 and
|
|
* bg-grid-white/5 for the integrations onboarding visuals.
|
|
*/
|
|
@utility bg-grid-* {
|
|
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='none' stroke='--value(--color-*)'><path d='M0 .5H31.5V32'/></svg>");
|
|
}
|
|
|
|
@utility tab-flares {
|
|
--tab-flare-ring:
|
|
transparent 6.75px, var(--border-color-default) 7.25px, var(--border-color-default) 7.75px,
|
|
transparent 8.25px;
|
|
--tab-flare-fill: transparent 6.75px, var(--background-color-200) 7.25px;
|
|
--tab-flare-left:
|
|
radial-gradient(circle at 0 0, var(--tab-flare-ring)),
|
|
radial-gradient(circle at 0 0, var(--tab-flare-fill));
|
|
--tab-flare-right:
|
|
radial-gradient(circle at 100% 0, var(--tab-flare-ring)),
|
|
radial-gradient(circle at 100% 0, var(--tab-flare-fill));
|
|
}
|
|
|
|
@utility no-scrollbar {
|
|
-ms-overflow-style: none; /* IE and Edge */
|
|
scrollbar-width: none; /* Firefox */
|
|
&::-webkit-scrollbar {
|
|
display: none; /* Chrome, Safari, Opera */
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Text shimmer (shadcn shimmer utility, inlined so we don't pull in the full
|
|
* shadcn CSS package). Apply `shimmer` to text to draw attention.
|
|
*/
|
|
@property --shimmer-angle {
|
|
syntax: '<angle>';
|
|
inherits: true;
|
|
initial-value: 20deg;
|
|
}
|
|
@property --shimmer-image {
|
|
syntax: '*';
|
|
inherits: false;
|
|
}
|
|
@property --shimmer-text-fill {
|
|
syntax: '*';
|
|
inherits: false;
|
|
}
|
|
|
|
@utility shimmer {
|
|
--_spread: var(--shimmer-spread, calc(3ch + 40px));
|
|
--_base: currentColor;
|
|
--_highlight: var(--shimmer-color, oklch(from currentColor l c h / calc(alpha* 0.2)));
|
|
|
|
background-image: var(
|
|
--shimmer-image,
|
|
linear-gradient(
|
|
calc(90deg + var(--shimmer-angle)),
|
|
var(--_base) calc(50% - var(--_spread)),
|
|
color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * 0.5),
|
|
var(--_highlight) 50%,
|
|
color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * 0.5),
|
|
var(--_base) calc(50% + var(--_spread))
|
|
)
|
|
);
|
|
background-repeat: no-repeat;
|
|
background-size: calc(200% + var(--_spread) * 2) 100%;
|
|
background-position: 0 0;
|
|
background-clip: text;
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: var(--shimmer-text-fill, transparent);
|
|
animation: tw-shimmer var(--shimmer-duration, 2s) linear infinite;
|
|
transition: -webkit-text-fill-color 0.5s ease;
|
|
|
|
/* Fade to solid text on dismiss — keep the gradient until fill is opaque */
|
|
&[data-shimmer-fading] {
|
|
-webkit-text-fill-color: currentColor;
|
|
animation-play-state: paused;
|
|
}
|
|
|
|
@variant dark {
|
|
--_highlight: var(
|
|
--shimmer-color,
|
|
oklch(from currentColor max(0.8, calc(l + 0.4)) c h / calc(alpha + 0.4))
|
|
);
|
|
}
|
|
|
|
&:where([dir='rtl'], [dir='rtl'] *) {
|
|
animation-direction: reverse;
|
|
}
|
|
}
|
|
|
|
@utility shimmer-once {
|
|
animation-iteration-count: 1;
|
|
}
|
|
|
|
@utility shimmer-reverse {
|
|
animation-direction: reverse;
|
|
}
|
|
|
|
@utility shimmer-none {
|
|
--shimmer-image: none;
|
|
--shimmer-text-fill: currentColor;
|
|
background-image: none;
|
|
-webkit-text-fill-color: currentColor;
|
|
}
|
|
|
|
@utility shimmer-color-* {
|
|
--shimmer-color: --value(--color-*, [color]);
|
|
--shimmer-color: color-mix(
|
|
in oklch,
|
|
--value(--color-*, [color]) calc(--modifier(integer) * 1%),
|
|
transparent
|
|
);
|
|
}
|
|
|
|
@utility shimmer-duration-* {
|
|
--shimmer-duration: calc(--value(integer) * 1ms);
|
|
}
|
|
|
|
@utility shimmer-spread-* {
|
|
--shimmer-spread: calc(var(--spacing) * --value(integer));
|
|
--shimmer-spread: --value([length], [percentage]);
|
|
}
|
|
|
|
@utility shimmer-angle-* {
|
|
--shimmer-angle: calc(--value(integer) * 1deg);
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.shimmer {
|
|
animation: none;
|
|
background-image: none;
|
|
-webkit-text-fill-color: currentColor;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Canonical keyboard focus rings. Prefer these over inventing local ring/outline
|
|
* stacks.
|
|
*
|
|
* - focus-ring: default offset ring (buttons, inputs, most controls).
|
|
* `outline-hidden` stays always-on so mouse click does not show the browser
|
|
* default; the ring is `:focus-visible` only.
|
|
* - focus-inset: dense/flush surfaces such as interactive <tr>s. Must use
|
|
* outline (not ring/box-shadow) — box-shadow on table-row is unreliable,
|
|
* especially in Safari. Do NOT pair with outline-hidden: that sets
|
|
* outline-style: none and suppresses the focus outline.
|
|
*/
|
|
@utility focus-ring {
|
|
@apply outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background;
|
|
}
|
|
|
|
@utility focus-inset {
|
|
/* Reserve outline geometry up front so focus never flashes the browser default. */
|
|
outline: 2px solid transparent;
|
|
outline-offset: -2px;
|
|
/* Call sites often add `transition`/`transition-all`; keep outline instant. */
|
|
transition-property:
|
|
color, background-color, border-color, text-decoration-color, fill, stroke, opacity, transform,
|
|
filter, backdrop-filter, box-shadow;
|
|
|
|
&:focus-visible {
|
|
outline-color: var(--ring);
|
|
border-radius: var(--radius-md, 0.375rem);
|
|
}
|
|
}
|