Files
Danny White a31ca2bad0 fix(ui): make brand text readable across themes (#49871)
## What kind of change does this PR introduce?

Bug fix and design-system update. Resolves DEPR-316.

Follow-up rename (`text-brand` → `text-primary`) is in a dedicated PR
(https://github.com/supabase/supabase/pull/50564) stacked on this one.

## What is the current behavior?

`text-brand` resolves to the canonical bright brand green in places that
need readable text, which fails WCAG AA on light surfaces. A separate
`text-brand-display` token adds another green for large type.

## What is the new behavior?

- `text-brand` maps to accessible `--primary` (light mode darkened to
meet ~4.5:1 AA)
- `--hue` / `--primary-hue` aligned to 157.5
- `text-brand-display` removed; former display callsites use
`text-brand`
- Bright fills/borders stay on `brand-default`
- Design-system colour and typography docs updated

| Before | After |
| --- | --- |
| <img width="514" height="112" alt="CleanShot 2026-09-02 at 11 13
09@2x"
src="https://github.com/user-attachments/assets/4e0138a9-a32d-4e4c-a426-90736706e1e7"
/> | <img width="512" height="138" alt="CleanShot 2026-09-21 at 11 42
05@2x"
src="https://github.com/user-attachments/assets/164cc5b1-a0c5-4e93-95f1-80016641a114"
/> |
| <img width="864" height="266" alt="CleanShot 2026-09-02 at 11 13
53@2x"
src="https://github.com/user-attachments/assets/3c1ca53f-bf9e-431e-bc15-816b4a275b8e"
/> | <img width="882" height="248" alt="CleanShot 2026-09-21 at 11 41
37@2x"
src="https://github.com/user-attachments/assets/24828e7b-ed6b-44cb-b9dc-becc3398bdfc"
/> |
| <img width="782" height="692" alt="CleanShot 2026-09-02 at 11 16
30@2x"
src="https://github.com/user-attachments/assets/fc871977-77bc-47fb-9e0e-9284e0ecd5cc"
/> | <img width="730" height="690" alt="CleanShot 2026-09-21 at 11 42
52@2x"
src="https://github.com/user-attachments/assets/bf479515-d5f9-471e-b82d-f097c0f4b56c"
/> |
| <img width="480" height="306" alt="CleanShot 2026-09-02 at 11 18
53@2x"
src="https://github.com/user-attachments/assets/03f341f4-f02e-44f8-a2b2-8c31670d0427"
/> | <img width="470" height="300" alt="CleanShot 2026-09-21 at 11 43
19@2x"
src="https://github.com/user-attachments/assets/9df18217-d5e6-48b8-ba0b-579d2664b94b"
/> |
| <img width="960" height="300" alt="CleanShot 2026-09-02 at 11 32
04@2x"
src="https://github.com/user-attachments/assets/6b1d9373-7a71-4247-81ff-26441604b09d"
/> | <img width="980" height="306" alt="CleanShot 2026-09-21 at 11 44
13@2x"
src="https://github.com/user-attachments/assets/41ad4784-02ec-4b29-b860-32af9fa79aa8"
/> |
| <img width="924" height="214" alt="CleanShot 2026-09-02 at 11 34
44@2x"
src="https://github.com/user-attachments/assets/1de661fe-c7b6-499b-a94f-e4737436ec79"
/> | <img width="752" height="162" alt="CleanShot 2026-09-21 at 11 44
56@2x"
src="https://github.com/user-attachments/assets/1811890f-0660-4445-84e9-447720954fa1"
/> |

## To test

Test each callsite **in light mode** (dark mode is largely unchanged).

### WWW

-
[Homepage](https://zone-www-dot-com-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/):
“Scale to millions” uses readable brand text (display token is gone)
-
[Careers](https://zone-www-dot-com-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/careers):
small “Careers” eyebrow readable; green dividers stay bright
`brand-default`
-
[Contact](https://zone-www-dot-com-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/contact-us):
email / policy links use readable brand text
-
[Regions](https://zone-www-dot-com-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/regions):
“Ask about early access to BYOC” readable

### Docs

- [Docs
homepage](https://docs-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/docs):
“DOCS” wordmark and resource links readable
- [Database
overview](https://docs-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/docs/guides/database/overview):
nav / footer brand links readable
- [JavaScript
reference](https://docs-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/docs/reference/javascript/introduction):
active sidebar treatment readable

### Design system

-
[Typography](https://design-system-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/docs/typography):
documents `text-brand` only (no display)
- [Colour
usage](https://design-system-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/docs/color-usage):
`text-brand` vs `bg-brand-default`
- [Design-system
homepage](https://design-system-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/):
brand text examples across themes

### Studio

- [Auth
providers](https://studio-staging-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/dashboard/project/_/auth/providers):
enabled provider badge text readable; status dot stays bright
- [Database
policies](https://studio-staging-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/dashboard/project/_/database/policies?new=true):
template hover text more legible
- [Database
connections](https://studio-staging-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/dashboard/project/_/observability/connections):
“Live” status readable; animated dot stays bright green

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-09-22 10:07:28 +10:00

351 lines
8.0 KiB
CSS

@reference "./globals.css";
.sb-grid {
@apply flex h-full flex-col;
}
.sb-grid-fill-container:after {
content: '';
display: inline-block;
width: 100%;
}
.rdg-cell {
@apply flex;
@apply text-grid;
@apply border-secondary border-r border-b;
@apply text-foreground;
padding-inline: 0.5rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: inherit;
}
/* Apply parent bg colour while editing */
.rdg-cell.rdg-editor-container > * {
background-color: inherit;
}
.rdg-cell > div[draggable='true'] {
@apply h-full;
}
.rdg-row .rdg-cell-frozen:nth-last-child(1 of .rdg-cell-frozen) {
@apply border-secondary border-r;
}
.rdg-cell[aria-selected='true'] {
box-shadow: inset 0 0 0 1px #24b47e;
}
.rdg:not(:focus-within):not(.rdg-context-menu-open) .rdg-cell[aria-selected='true'] {
box-shadow: none;
outline: none;
}
/* Cell with unsaved changes - warning (amber) background/text color */
.rdg-cell.rdg-cell--dirty {
background-color: hsl(var(--warning-300) / 0.75);
color: hsl(var(--warning-600));
}
/* Row pending addition - green background, green text */
.rdg-row.rdg-row--added {
background-color: hsl(var(--brand-200) / 0.3);
&:hover {
background-color: hsl(var(--brand-200) / 0.5);
}
.rdg-cell {
border-left-color: hsl(var(--brand-default));
color: var(--primary);
}
/* First cell gets a stronger left border to indicate new row */
.rdg-cell:first-child {
box-shadow: inset 2px 0 0 0 hsl(var(--brand-default));
}
}
/* Row pending deletion - red background with strikethrough effect, red text */
.rdg-row.rdg-row--deleted {
background-color: hsl(var(--destructive-300) / 0.3);
&:hover {
background-color: hsl(var(--destructive-300) / 0.5);
}
.rdg-cell {
text-decoration: line-through;
text-decoration-color: hsl(var(--destructive-default));
border-left-color: hsl(var(--destructive-default));
color: hsl(var(--destructive-default));
}
/* First cell gets a stronger left border to indicate deleted row */
.rdg-cell:first-child {
box-shadow: inset 2px 0 0 0 hsl(var(--destructive-default));
}
}
.rdg {
@apply box-border select-none overflow-x-auto overflow-y-scroll bg-dash-canvas;
@apply border-t border-r-0 border-l-0;
contain: strict;
font-size: 14px;
}
.rdg *,
.rdg ::after,
.rdg ::before {
box-sizing: inherit;
}
@supports not (contain: strict) {
.rdg {
position: relative;
z-index: 0;
}
}
.rdg-focus-sink {
position: sticky;
top: 0;
left: 0;
height: 0;
width: 0;
outline: 0;
}
/*
Row header
*/
.rdg-header-row {
@apply select-none border-none;
}
.rdg-header-row {
height: var(--header-row-height);
line-height: var(--header-row-height);
top: 0;
}
.rdg-header-row .rdg-cell {
@apply bg-dash-canvas border-default border-b;
}
.rdg-header-row .rdg-cell-frozen:nth-last-child(1 of .rdg-cell-frozen) {
@apply border-default border-r border-b;
}
[data-theme='dark'] .rdg-row .rdg-cell-frozen:nth-last-child(1 of .rdg-cell-frozen),
[data-theme='dark'] .rdg-header-row .rdg-cell-frozen:nth-last-child(1 of .rdg-cell-frozen) {
@apply border-r-strong;
}
.rdg-header-row .rdg-cell p {
@apply text-typography-body-light [[data-theme*=dark]_&]:text-typography-body-dark;
}
.rdg-header-row .rdg-checkbox {
@apply bg-200 border-default rounded-xs border;
}
.rdg-header-row .rdg-checkbox-input:checked + .rdg-checkbox {
@apply border-default border-4 bg-green-900;
}
.rdg-header-row .rdg-checkbox-input:focus + .rdg-checkbox {
box-shadow: none;
}
.rdg-cell .Select {
max-height: 30px;
font-size: 12px;
font-weight: 400;
}
/*
Row
*/
.rdg-row {
@apply bg-dash-sidebar transition-colors;
@apply hover:bg-200;
}
/* edit button */
.rdg-row__select-column__edit-action {
@apply opacity-0;
}
.rdg-row:hover .rdg-row__select-column__edit-action {
@apply opacity-100;
}
.rdg-row__select-column__edit-action:hover {
opacity: 1 !important;
}
/* select row */
.rdg-row[aria-selected='true'] {
@apply bg-200;
}
.tab-cursor {
cursor: pointer !important;
}
/*
Checkbox
*/
.sb-grid {
/* reset styles */
[type='checkbox'] {
webkit-appearance: none;
-moz-appearance: none;
appearance: none;
padding: 0;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
display: inline-block;
vertical-align: middle;
background-origin: border-box;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
flex-shrink: 0;
height: 1rem;
width: 1rem;
color: #2563eb;
background-color: #fff;
border-color: #6b7280;
border-width: 1px;
}
[type='checkbox']:checked {
@apply bg-foreground;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='hsl(0, 0%, 100%)'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E") !important;
}
[type='checkbox']:indeterminate {
@apply bg-foreground;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='hsl(0, 0%, 100%)'%3E%3Crect x='3' y='7' width='10' height='2'/%3E%3C/svg%3E") !important;
[data-theme='dark'] & {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='hsl(0, 0%, 0%)'%3E%3Crect x='3' y='7' width='10' height='2'/%3E%3C/svg%3E") !important;
}
}
[type='checkbox'] {
@apply cursor-pointer rounded-sm border border-solid;
@apply text-foreground border-strong transition-all;
@apply hover:border-foreground focus:ring-0 focus:outline-hidden;
@apply bg-control;
margin-top: 2px;
}
}
/* Dark mode */
[data-theme='dark'] .sb-grid [type='checkbox']:checked {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='hsl(0, 0%, 0%)'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E") !important;
}
.rdg__segmented-control {
@apply border-default relative mx-2 h-8 rounded-md border;
}
.rdg__segmented-control__button {
@apply absolute top-0 inline-flex h-full items-center justify-center;
@apply text-xs font-medium;
@apply text-border-muted;
@apply active:bg-alternative hover:text-white focus:z-10 focus:outline-hidden;
@apply transition duration-150 ease-in-out;
@apply cursor-pointer;
z-index: 1;
}
.rdg__segmented-control__button--option {
@apply text-background;
}
.rdg__segmented-control__button--right {
@apply right-0;
}
.rdg__segmented-control__button--left {
@apply left-0;
}
.rdg__segmented-control__label {
@apply bg-overlay-hover border-control z-0 inline-block h-full transform rounded-sm border shadow-sm transition duration-200 ease-in-out;
}
.rdg__segmented-control__label--left {
@apply translate-x-0;
}
.rdg__segmented-control__label--right {
@apply translate-x-12;
}
.rdg__segmented-control__options-label {
@apply uppercase;
color: inherit;
}
/*
ColumnHeader
*/
.sb-grid-column-header {
@apply flex h-full w-full items-center justify-between;
}
.sb-grid-column-header--cursor {
@apply cursor-default;
}
.sb-grid-column-header__inner {
@apply flex items-center gap-2 overflow-hidden text-ellipsis;
}
.sb-grid-column-header__inner__name {
@apply text-foreground overflow-hidden text-ellipsis text-xs select-text;
}
.sb-grid-column-header__inner__format {
@apply text-xs;
@apply overflow-hidden text-ellipsis font-normal;
@apply text-foreground-light;
}
.sb-grid-column-header__inner__primary-key {
@apply flex rotate-45 transform items-center;
}
.sb-grid-column-header__inner svg {
@apply border-brand-default text-brand;
}
/*
SelectColumn
*/
.sb-grid-select-cell__formatter {
@apply flex h-full w-full items-center justify-between;
}
.sb-grid-select-cell__header {
@apply flex h-full w-full items-center justify-between;
}
.sb-grid-select-cell__header__input {
/* @apply focus:ring-brand-300; */
@apply border-background-surface-100;
}