Themes

A default theme is built in, and a brand is a CSS file you load after it. The screen below is the same code twice, on this page. The only difference is a data-brand attribute on the second panel.

Side by side

BaseBuilt in. What every project starts from.

Project settings

Details

How the project shows up for your team.

PortfolioA brand file loaded after base.

Project settings

Details

How the project shows up for your team.

How themes work

Base is brand-neutral: a real gray, the system font, a near-black accent. It’s complete on its own, so a new project looks finished before it has a brand. Everything on this site outside the portfolio panel above is base.

A brand overrides semantic tokens and nothing else, in a file loaded after base. Components never know which brand is active. The portfolio brand ships in the package as a working example: copy portfolio-light.css and portfolio-dark.css into your project, rename them, and change the values.

Loading a brand
// Base, built in: every project loads these two.
import '@amezquita/design-system/styles/brands/base-light.css'
import '@amezquita/design-system/styles/brands/base-dark.css'

// A brand, loaded after base. Only the tokens it changes are in it.
import './brand-light.css'
import './brand-dark.css'
brand-light.css
/* brand-light.css — a file you own, copied from portfolio-light.css */
:root, [data-mode="light"] {
  --color-accent-default: #15616d;
  --color-accent-hover: #0f4750;
  --font-family-base: 'Your Font', sans-serif;
}

portfolio-light.css and portfolio-dark.css set their tokens on :root, so they restyle the whole page. To show a brand in one part of a page, as this page does, load portfolio-scoped.css instead of those two and put data-brand="portfolio" on the part. It follows the page’s data-mode, or its own.

One brand inside a page
import '@amezquita/design-system/styles/brands/base-light.css'
import '@amezquita/design-system/styles/brands/base-dark.css'
import '@amezquita/design-system/styles/brands/portfolio-scoped.css'

<div data-brand="portfolio">…</div>

What the portfolio changes

35 tokens resolve differently in the portfolio brand, in at least one mode. Everything else is inherited from base.

TokenBase lightPortfolio lightBase darkPortfolio dark
--color-neutral-50#FAFAFA#FAFAF9#171717#1c1917
--color-neutral-100#F5F5F5#F4F0EB#262626#292524
--color-neutral-200#E5E5E5#E2DDD9#404040#44403c
--color-neutral-300#D4D4D4#C8C3BE#525252#57534e
--color-neutral-400#A3A3A3#A8A29E#737373#78716c
--color-neutral-500#737373#78716C#A3A3A3#a8a29e
--color-neutral-600#525252#57534E#D4D4D4#c8c3be
--color-neutral-700#404040#44403C#E5E5E5#e2ddd9
--color-neutral-800#262626#292524#F5F5F5#f4f0eb
--color-neutral-900#171717#1C1917#FAFAFA#fafaf9
--color-surface-primary#FAFAFA#FAFAF9#171717#1c1917
--color-surface-secondary#F5F5F5#F4F0EB#262626#292524
--color-surface-tertiary#E5E5E5#E2DDD9#404040#44403c
--color-surface-inverse#171717#1C1917#FAFAFA#fafaf9
--color-text-primary#0A0A0A#0A0A0A#FAFAFA#fafaf9
--color-text-secondary#525252#57534E#D4D4D4#c8c3be
--color-text-inverse#FAFAFA#FAFAF9#171717#1c1917
--color-accent-default#262626#292524#F5F5F5#f4f0eb
--color-accent-hover#171717#1C1917#FAFAFA#fafaf9
--color-accent-foreground#FFFFFF#FFFFFF#171717#1c1917
--color-border-default#E5E5E5#E2DDD9#404040#57534e
--color-border-strong#A3A3A3#A8A29E#737373#78716c
--color-border-focus#0A0A0A#0A0A0A#FAFAFA#fafaf9
--color-curtain#D4D4D4#C8C3BE#525252#44403c
--color-feedback-error-background#FEF2F2#FEF2F2#262626#292524
--color-feedback-success-background#F0FDF4#F0FDF4#262626#292524
--color-feedback-warning-background#FFFBEB#FFFBEB#262626#292524
--color-feedback-info-background#EFF6FF#EFF6FF#262626#292524
--color-skeleton-base#E5E5E5#E2DDD9#404040#44403c
--color-skeleton-highlight#F5F5F5#F4F0EB#262626#292524
--font-family-base-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif'Schibsted Grotesk', sans-serif-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif'Schibsted Grotesk', sans-serif
--font-family-heading-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif'Schibsted Grotesk', sans-serif-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif'Schibsted Grotesk', sans-serif
--button-secondary-foreground#262626#292524#A3A3A3#a8a29e
--button-secondary-border#262626#292524#A3A3A3#a8a29e
--button-secondary-background-hover#262626#292524#A3A3A3#a8a29e

What the portfolio adds

Tokens that exist only in the portfolio brand. No component in the package uses them; they’re for the portfolio site’s own CSS.

TokenBase lightPortfolio lightBase darkPortfolio dark
--color-surface-spotlight—#1C1917—#0F4750
--color-text-frozen-primary—#1C1917—#1C1917
--color-text-frozen-secondary—#57534E—#57534E
--color-accent-glow—#15616D33—#15616D80