Docs
Color usage

Color usage

Colors system breakdown with best practise

Colors available in the Supabase Design System

These are examples of using colors with shorthands.

Background

bg-200
bg
bg-alternative-200
bg-alternative
bg-selection
bg-control
bg-surface-75
bg-surface-100
bg-surface-200
bg-surface-300
bg-surface-400
bg-overlay
bg-overlay-hover
bg-muted
bg-button
bg-dialog
bg-dash-sidebar
bg-dash-canvas

App backgrounds

We use backgrounds in 2 different ways. In the ./www and ./docs sites, we use a darker background, so we have an extra background color we can use

/**
 * ./www background color
 * ./docs background color
 */
<body className="bg">{children}</body>
 
/**
 * ./studio background color
 */
<body className="bg-studio">{children}</body>

Backgrounds and Surfaces

./apps/www + ./apps/docs

We use surfaces in 2 different ways. In the ./www and ./docs sites, we use a darker background, so we have an extra surface color we can use

app backgroundbg
content panelbg-surface-75border-muted

./apps/studio

For the studio (dashbaord) we can use bg-surface-100, bg-surface-200, bg-surface-300

app backgroundbg-studio
content panelbg-surface-100border
content panelbg-surface-200border
content panelbg-surface-300border

Data grid and frame space

Data grids use an alternative background color for empty space to add depth to the layout. The background of the empty space is the same background as used in ./apps/docs and ./apps/www - although; the color has been mapped to bg-alternative so it works well across different themes.

grid headerbg-surface-200border
content rowbg-200border-secondary
content rowbg-200border-secondary
content rowbg-200border-secondary
content rowbg-200border-secondary
empty frame spacebg-alternativeborder-stronger

Dealing with large areas of emmpty space in data display should also be catered for. You can use the bg-200 or bg class to fill the space.

Overlays

We use the ./bg-overlay background color for overlays. This is not to be confused with Dialogs, they require to use the same app background color as the site.

Border

border
border-muted
border-secondary
border-overlay
border-control
border-alternative
border-strong
border-stronger
border-button
border-button-hover

Text

These can also be accessed with foreground. Like text-foreground-light.

Postgrestext
Postgrestext-light
Postgrestext-lighter
Postgrestext-muted
Postgrestext-contrast

Other Colors

These can also be accessed with foreground. Like text-foreground-light.

bg-destructive-200
bg-destructive-300
bg-destructive-400
bg-destructive-500
bg-destructive-600
bg-destructive
bg-warning-200
bg-warning-300
bg-warning-400
bg-warning-500
bg-warning-600
bg-warning
bg-brand-200
bg-brand-300
bg-brand-400
bg-brand-500
bg-brand-600
bg-brand
bg-brand-button
bg-brand-link
bg-_secondary-200
bg-_secondary-400
bg-_secondary
bg-code_block-1
bg-code_block-2
bg-code_block-3
bg-code_block-4
bg-code_block-5