Philosophy
Conty’s token system is built on three core principles:- Semantic Naming - Tokens describe purpose, not appearance
- Cross-Platform Support - Tokens work in CSS, JavaScript, and native platforms
- Theme-Aware - All tokens automatically adapt to light and dark modes
Token Architecture
Conty uses a three-layer token architecture that promotes maintainability and consistency:Core Tokens
Raw values defined in OKLCH color space and rem units. These are the primitive values that never change based on context.
Semantic Tokens
Purpose-driven tokens that reference core tokens. These describe intent rather than appearance.
Token Categories
Conty organizes tokens into logical categories:Colors
Surface, text, brand, border, and status colors with OKLCH support
Spacing
Consistent spacing scale using rem units for accessibility
Typography
Font families, text sizes, and type scale definitions
Theming
Light/dark mode implementation and custom theme creation
Why OKLCH?
Conty uses the OKLCH color space for several advantages:- Perceptually Uniform - Equal changes in values result in equal visual differences
- Wider Gamut - Access to more vibrant colors on modern displays
- Predictable Lightness - Lightness values directly correspond to perceived brightness
- Better Accessibility - Easier to maintain WCAG contrast ratios
OKLCH is supported in all modern browsers (Chrome 111+, Safari 15.4+, Firefox 113+). For older browsers, Conty provides fallback values.
Usage
Tokens can be accessed in multiple ways depending on your use case:- JavaScript/TypeScript
- CSS
- Tailwind CSS
Import tokens directly from the package:
Semantic vs Legacy Tokens
Conty provides both semantic tokens (recommended) and legacy aliases for backward compatibility:New projects should use semantic tokens. Legacy aliases are maintained for teams migrating from older versions.
Migration Guide
If you’re using legacy token paths, migrate to semantic tokens:Next Steps
Explore Color Tokens
Learn about surface, text, brand, border, and status colors
Understand Spacing
Master the spacing scale and layout tokens
Typography System
Discover font families and text size tokens
Theme Configuration
Set up light/dark modes and create custom themes