← Back to Design System Home

CSS Layers Showcase

Demonstration of Atlas Design System using CSS Layers for organized and maintainable styles

CSS Layers Overview

🎯 What are CSS Layers?

CSS Layers provide a way to organize and control the cascade order of styles. This design system uses layers to separate base tokens, semantic tokens, spacing, typography, effects, layout, components, utilities, and overrides.

Layer Structure

@layer atlas.base, atlas.semantic, atlas.spacing, atlas.typography, atlas.effects, atlas.layout, atlas.components, atlas.utilities, atlas.overrides

💡 Benefits of CSS Layers

Organization: Clear separation of concerns
Maintainability: Easy to find and modify specific token categories
Performance: Better browser optimization
Flexibility: Easy to override specific layers when needed

Base Colors (atlas.base layer)

Layer: atlas.base

Contains all base color tokens including neutral, primary, blue, green, orange, yellow, and red color palettes.

Primary Colors

50
Primary 50
var(--primary-50)
100
Primary 100
var(--primary-100)
200
Primary 200
var(--primary-200)
300
Primary 300
var(--primary-300)
400
Primary 400
var(--primary-400)
500
Primary 500
var(--primary-500)
600
Primary 600
var(--primary-600)
700
Primary 700
var(--primary-700)
800
Primary 800
var(--primary-800)
900
Primary 900
var(--primary-900)

Semantic Colors (atlas.semantic layer)

Layer: atlas.semantic

Contains semantic color tokens that reference base colors for consistent theming across the application.

Surface Colors

Primary
Surface Primary
var(--surface-primary)
Secondary
Surface Secondary
var(--surface-secondary)
Brand
Surface Brand Primary
var(--surface-brand-primary)
Accent
Surface Accent
var(--surface-accent)
Negative
Surface Negative
var(--surface-negative)
Warning
Surface Warning
var(--surface-warning)
Positive
Surface Positive
var(--surface-positive)

Spacing (atlas.spacing layer)

Layer: atlas.spacing

Contains all spacing tokens including number values and semantic spacing references.

4
var(--spacing-4)
8
var(--spacing-8)
12
var(--spacing-12)
16
var(--spacing-16)
20
var(--spacing-20)
24
var(--spacing-24)
32
var(--spacing-32)
40
var(--spacing-40)
48
var(--spacing-48)
64
var(--spacing-64)

Typography (atlas.typography layer)

Layer: atlas.typography

Contains all typography tokens including font sizes, weights, and line heights for consistent text styling.

Display Large
Size: var(--text-style-display-large-size-rem)
Weight: var(--text-style-display-large-weight)
Line Height: var(--text-style-display-large-line-height-rem)
Headline Large
Size: var(--text-style-headline-large-size-rem)
Weight: var(--text-style-headline-large-weight)
Line Height: var(--text-style-headline-large-line-height-rem)
Title Large
Size: var(--text-style-title-large-size-rem)
Weight: var(--text-style-title-large-weight)
Line Height: var(--text-style-title-large-line-height-rem)
Body Large
Size: var(--text-style-body-large-size-rem)
Weight: var(--text-style-body-large-weight)
Line Height: var(--text-style-body-large-line-height-rem)
Body Medium
Size: var(--text-style-body-medium-size-rem)
Weight: var(--text-style-body-medium-weight)
Line Height: var(--text-style-body-medium-line-height-rem)
Label Medium
Size: var(--text-style-label-medium-size-rem)
Weight: var(--text-style-label-medium-weight)
Line Height: var(--text-style-label-medium-line-height-rem)

Effects (atlas.effects layer)

Layer: atlas.effects

Contains border radius, stroke width, and elevation (shadow) tokens for visual effects.

Border Radius

4
4
var(--radius-4)
8
8
var(--radius-8)
12
12
var(--radius-12)
16
16
var(--radius-16)
20
20
var(--radius-20)
24
24
var(--radius-24)
Full
Full
var(--radius-full)

Shadows

1
Elevation 1
var(--elevation-1)
2
Elevation 2
var(--elevation-2)
3
Elevation 3
var(--elevation-3)
4
Elevation 4
var(--elevation-4)
5
Elevation 5
var(--elevation-5)

Layout (atlas.layout layer)

Layer: atlas.layout

Contains grid system tokens for responsive layout and navigation.

Mobile Columns
var(--mobile-columns)
Mobile Gutter
var(--mobile-gutter-rem)
Mobile Navigation Columns
var(--mobile-navigation-columns)
Mobile Navigation Gutter
var(--mobile-navigation-gutter-rem)

Gradient Showcase (atlas.base layer)

Layer: atlas.base

Beautiful gradient combinations using the design system's predefined gradient tokens.

Gradient Cards

🎨

Warm Gradient

A beautiful warm gradient that combines neutral and orange tones for a welcoming feel.

❄️

Cool Gradient

A subtle cool gradient perfect for professional interfaces and clean designs.

🌿

Nature Gradient

A fresh green gradient inspired by nature, ideal for eco-friendly and organic brands.

Golden Gradient

A luxurious golden gradient that adds elegance and premium feel to any design.

Utilities (atlas.utilities layer)

Layer: atlas.utilities

Contains utility classes for common patterns like horizontal scrolling and accessibility helpers.

Horizontal Scroll Utility

The .scroll-horizontal class provides horizontal scrolling functionality:

Item 1
Item 2
Item 3
Item 4

Accessibility Utilities

The visually hidden utilities help with accessibility by hiding content visually while keeping it available to screen readers.

This content is visually hidden but accessible to screen readers. It will appear when focused or activated.