Design Tokens
Meteor uses design tokens organized in a hierarchical structure:- Primitives: Base color palettes and scale values
- Semantic tokens: Context-specific tokens that reference primitives
- Component tokens: Component-specific styling tokens
Token Structure
Tokens are defined in JSON format and compiled to CSS custom properties. Here’s how the token system is organized:Using CSS Custom Properties
All design tokens are available as CSS custom properties (CSS variables) that you can use in your stylesheets.Color Tokens
Meteor provides comprehensive color tokens for different use cases:Available Color Categories
- Interaction:
primary,secondary,critical - Elevation:
surface,backdrop,floating,shadow - Background:
primary,secondary,tertiary,brand,critical,attention,positive,accent - Text:
primary,secondary,brand,critical,accent - Border:
primary,secondary,brand,critical,attention,positive - Icon:
primary,secondary,brand,critical,attention,positive
Typography Tokens
Customize typography using font-related tokens:Spacing Tokens
Use the scale system for consistent spacing:0, 1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 36, 40, 48, 56, 64, 72, 80, 96, 128, 160, 192, 224, 256
Border Radius Tokens
none, 2xs, xs, s, m, l, xl, 2xl, 3xl, 4xl, round, card, button, checkbox
Importing Token Files
Meteor provides pre-compiled CSS files for different themes:Customizing Tokens
You can override any token by redefining the CSS custom property:Theme Switching
Implement theme switching by conditionally applying token files:Token Reference
For a complete list of available tokens, you can:- Browse the token JSON files in the
@shopware-ag/meteor-tokenspackage - Inspect the compiled CSS files in
node_modules/@shopware-ag/meteor-tokens/deliverables/ - Use browser DevTools to explore available CSS custom properties
Best Practices
-
Use semantic tokens: Prefer semantic tokens (e.g.,
--color-text-primary-default) over primitive tokens (e.g.,--color-zinc-900) for better theme support - Maintain consistency: Use the provided scale system for spacing instead of arbitrary values
- Test both themes: If implementing custom overrides, test in both light and dark themes
- Don’t hardcode values: Always use tokens instead of hardcoding colors, sizes, or other design values
- Follow naming conventions: When creating custom tokens, follow the existing naming patterns for clarity
Example: Custom Theme
Here’s a complete example of customizing Meteor for your brand:Next Steps
- Explore the Component Library to see tokens in action
- Check Accessibility Guidelines for color contrast requirements
- Learn how to Contribute custom tokens back to Meteor