| name | design-system |
| description | Complete reference for Rubin Observatory design system CSS variables and design tokens. Use this skill when styling components, referencing CSS custom properties, understanding the design token architecture, or working with colors, spacing, typography, and other design primitives. Covers both rubin-style-dictionary foundation tokens and squareone-specific tokens. |
Design System & CSS Variables Reference
Complete guide to the Rubin Observatory design system CSS variables (custom properties) available for styling components.
CSS Variable Sources
The design system is built from two complementary sources:
1. Rubin Style Dictionary (@lsst-sqre/rubin-style-dictionary)
Location: packages/rubin-style-dictionary/dist/tokens.css
Foundation design tokens generated from Style Dictionary. These are the base tokens that define the Rubin Observatory visual identity.
Prefix: --rsd-* (Rubin Style Dictionary)
2. Global CSS (@lsst-sqre/global-css)
Location: packages/global-css/src/tokens.css
Custom properties that build upon and extend the Rubin Style Dictionary tokens. These are application-specific tokens for squareone and other apps.
Prefix: --sqo-* (Squareone)
Importing Design Tokens
In React Components
import '@lsst-sqre/global-css';
.container {
padding: var(--sqo-space-md);
background-color: var(--rsd-color-primary-600);
}
In CSS Modules
.myClass {
color: var(--rsd-color-primary-600);
padding: var(--sqo-space-md);
}
Available Design Tokens
Colors (Rubin Style Dictionary)
All colors follow the --rsd-color-{name}-{weight} pattern.
Primary Colors (Teal)
--rsd-color-primary-100
--rsd-color-primary-200
--rsd-color-primary-300
--rsd-color-primary-400
--rsd-color-primary-500
--rsd-color-primary-600
--rsd-color-primary-700
--rsd-color-primary-800
Blue Scale
--rsd-color-blue-100
--rsd-color-blue-200
--rsd-color-blue-300
--rsd-color-blue-400
--rsd-color-blue-500
--rsd-color-blue-600
--rsd-color-blue-700
--rsd-color-blue-800
Green Scale
--rsd-color-green-100
--rsd-color-green-200
--rsd-color-green-300
--rsd-color-green-400
--rsd-color-green-500
--rsd-color-green-600
--rsd-color-green-700
--rsd-color-green-800
Red Scale
--rsd-color-red-100
--rsd-color-red-200
--rsd-color-red-300
--rsd-color-red-400
--rsd-color-red-500
--rsd-color-red-600
--rsd-color-red-700
--rsd-color-red-800
Orange Scale
--rsd-color-orange-100
--rsd-color-orange-200
--rsd-color-orange-300
--rsd-color-orange-400
--rsd-color-orange-500
--rsd-color-orange-600
--rsd-color-orange-700
--rsd-color-orange-800
Yellow Scale
--rsd-color-yellow-100
--rsd-color-yellow-200
--rsd-color-yellow-300
--rsd-color-yellow-400
--rsd-color-yellow-500
--rsd-color-yellow-600
--rsd-color-yellow-700
--rsd-color-yellow-800
Purple Scale
--rsd-color-purple-100
--rsd-color-purple-200
--rsd-color-purple-300
--rsd-color-purple-400
--rsd-color-purple-500
--rsd-color-purple-600
--rsd-color-purple-700
--rsd-color-purple-800
Gray Scale
--rsd-color-gray-000
--rsd-color-gray-100
--rsd-color-gray-500
--rsd-color-gray-800
--rsd-color-gray-900
Imagotype Colors (Branding)
--rsd-color-imagotype-light
--rsd-color-imagotype-dark
--rsd-color-imagotype-black
--rsd-color-imagotype-white
Component Colors (Semantic)
Pre-defined semantic colors for common UI components:
--rsd-component-header-background-color
--rsd-component-header-nav-text-color
--rsd-component-header-nav-text-hover-color
--rsd-component-header-nav-menulist-text-color
--rsd-component-header-nav-menulist-background-color
--rsd-component-header-nav-menulist-selected-background-color
--rsd-component-page-background-color
--rsd-component-footer-background-color
--rsd-component-service-card-background-color
--rsd-component-service-card-text-color
--rsd-component-text-color
--rsd-component-text-reverse-color
--rsd-component-text-link-color
--rsd-component-text-link-hover-color
--rsd-component-text-link-reverse-color
--rsd-component-text-headline-color
--rsd-component-image-invert
Squareone Application Colors
Application-specific color tokens from @lsst-sqre/global-css:
--sqo-doc-card-background-color
--sqo-primary-button-background-color
--sqo-primary-button-background-color-hover
--sqo-primary-button-background-color-active
--sqo-primary-button-text-color
Spacing
Prefix: --sqo-space-*
Spacing uses a modular scale based on 1em (responsive) or 1rem (fixed).
Responsive Spacing (based on font-size)
--sqo-space-unit
--sqo-space-xxxs
--sqo-space-xxs
--sqo-space-xs
--sqo-space-sm
--sqo-space-md
--sqo-space-lg
--sqo-space-xl
--sqo-space-xxl
--sqo-space-xxxl
Fixed Spacing (always uses root font-size)
--sqo-space-unit-fixed
--sqo-space-xxxs-fixed
--sqo-space-xxs-fixed
--sqo-space-xs-fixed
--sqo-space-sm-fixed
--sqo-space-md-fixed
--sqo-space-lg-fixed
--sqo-space-xl-fixed
--sqo-space-xxl-fixed
--sqo-space-xxxl-fixed
--size-screen-padding-min
Usage guideline: Use responsive spacing for component internals that should scale with text size. Use fixed spacing for layout that should remain consistent.
Border Radius
Prefix: --sqo-border-radius-*
--sqo-border-radius-0
--sqo-border-radius-1
--sqo-border-radius-2
Elevations (Shadows)
Prefix: --sqo-elevation-*
Based on Tailwind CSS shadow system. Use for depth and layering.
--sqo-elevation-0
--sqo-elevation-xs
--sqo-elevation-sm
--sqo-elevation-base
--sqo-elevation-md
--sqo-elevation-lg
--sqo-elevation-xl
--sqo-elevation-2xl
--sqo-elevation-inner
--sqo-elevation-outline
Example usage:
.card {
box-shadow: var(--sqo-elevation-md);
}
.modal {
box-shadow: var(--sqo-elevation-2xl);
}
.button:focus {
box-shadow: var(--sqo-elevation-outline);
}
Transitions
Prefix: --sqo-transition-*
--sqo-transition-basic
Asset Paths
Prefix: --rsd-asset-image-*
CSS variables for Rubin Observatory brand assets. Use with url():
--rsd-asset-image-favicon-svg
--rsd-asset-image-favicon-png-32-px
--rsd-asset-image-favicon-png-49-px
--rsd-asset-image-construction-agencies-png
--rsd-asset-image-operations-agencies-png
--rsd-asset-image-rubin-imagotype-color-on-black-png
--rsd-asset-image-rubin-imagotype-color-on-black-svg
--rsd-asset-image-rubin-imagotype-color-on-white-png
--rsd-asset-image-rubin-imagotype-color-on-white-svg
--rsd-asset-image-rubin-imagotype-gray-on-black-png
--rsd-asset-image-rubin-imagotype-gray-on-black-svg
--rsd-asset-image-rubin-imagotype-gray-on-white-png
--rsd-asset-image-rubin-imagotype-gray-on-white-svg
--rsd-asset-image-rubin-imagotype-color-on-black-crop-png
--rsd-asset-image-rubin-imagotype-color-on-black-crop-svg
--rsd-asset-image-rubin-imagotype-color-on-white-crop-png
--rsd-asset-image-rubin-imagotype-color-on-white-crop-svg
--rsd-asset-image-rubin-imagotype-gray-on-black-crop-png
--rsd-asset-image-rubin-imagotype-gray-on-black-crop-svg
--rsd-asset-image-rubin-imagotype-gray-on-white-crop-png
--rsd-asset-image-rubin-imagotype-gray-on-white-crop-svg
--rsd-asset-image-rubin-imagotype-email-png
--rsd-asset-image-rubin-watermark-watermark-png
--rsd-asset-image-rubin-watermark-letterhead-watermark-png
--rsd-asset-image-rubin-watermark-letterhead-watermark-2-png
Example usage:
.logo {
background-image: url(var(--rsd-asset-image-rubin-imagotype-color-on-white-svg));
}
Typography
Note: Typography tokens are not currently in the design system CSS variables. Use standard CSS font properties or consider adding to future token definitions.
Common patterns in the codebase:
.heading {
font-weight: 600;
font-size: 1.5rem;
}
.body {
font-weight: 400;
font-size: 1rem;
line-height: 1.5;
}
Dark Mode / Theming
Dark mode is implemented via data attributes and CSS variable overrides:
:root {
--sqo-doc-card-background-color: var(--rsd-color-gray-000);
}
[data-theme='dark'] body {
--sqo-doc-card-background-color: var(--rsd-color-primary-800);
}
Toggle dark mode by setting data-theme="dark" on a parent element (typically <html> or <body>).
Usage Patterns
Basic Component Styling
.container {
padding: var(--sqo-space-md);
background-color: var(--rsd-color-primary-600);
border-radius: var(--sqo-border-radius-1);
box-shadow: var(--sqo-elevation-md);
color: var(--rsd-component-text-reverse-color);
transition: var(--sqo-transition-basic);
}
.container:hover {
background-color: var(--rsd-color-primary-500);
box-shadow: var(--sqo-elevation-lg);
}
Semantic Color Usage
.link {
color: var(--rsd-component-text-link-color);
}
.link:hover {
color: var(--rsd-component-text-link-hover-color);
}
.darkSection {
background-color: var(--rsd-component-header-background-color);
color: var(--rsd-component-text-reverse-color);
}
.darkSection a {
color: var(--rsd-component-text-link-reverse-color);
}
State Variants with Data Attributes
.button {
background-color: var(--rsd-color-primary-600);
padding: var(--sqo-space-sm) var(--sqo-space-md);
border-radius: var(--sqo-border-radius-1);
}
.button[data-variant='secondary'] {
background-color: var(--rsd-color-blue-600);
}
.button[data-size='large'] {
padding: var(--sqo-space-md) var(--sqo-space-lg);
}
Responsive Spacing
.textBlock {
padding: var(--sqo-space-md);
margin-bottom: var(--sqo-space-lg);
}
.pageSection {
padding: var(--sqo-space-lg-fixed);
max-width: 1200px;
}
Best Practices
- Always use design tokens - Never hardcode colors, spacing, or other design values
- Prefer semantic tokens - Use
--rsd-component-text-color over direct color scales when available
- Use appropriate color weights - 600-800 for text/solid backgrounds, 100-400 for soft backgrounds
- Choose spacing type - Responsive (
--sqo-space-*) for content, fixed (--sqo-space-*-fixed) for layout
- Layer elevations logically - Base → sm → md → lg → xl → 2xl from bottom to top
- Reference Rubin Visual Identity Manual - When in doubt about color usage
- Test in both light and dark modes - If using themeable colors
- Document custom tokens - If creating new application-specific tokens
Accessing Source Files
View Rubin Style Dictionary tokens
cat packages/rubin-style-dictionary/dist/tokens.css
ls packages/rubin-style-dictionary/tokens/
View Squareone custom tokens
cat packages/global-css/src/tokens.css
Modify design tokens
Rubin Style Dictionary (base tokens):
- Edit JSON files in
packages/rubin-style-dictionary/tokens/
- Run build:
pnpm build --filter @lsst-sqre/rubin-style-dictionary
- Generated CSS appears in
dist/tokens.css
Squareone tokens (application-specific):
- Edit
packages/global-css/src/tokens.css directly
- No build step needed - changes immediately available
Missing Tokens?
If you need a token that doesn't exist:
For new base tokens (colors, etc.)
Add to Rubin Style Dictionary:
- Add to
packages/rubin-style-dictionary/tokens/*.json
- Rebuild package
- Use with
--rsd-* prefix
For application-specific tokens
Add to Global CSS:
- Add to
packages/global-css/src/tokens.css
- Use with
--sqo-* prefix
- Consider if it should be built on existing
--rsd-* tokens
Related Skills
- component-creation - Using design tokens in new components
- squared-package - CSS Modules and design token integration
References