Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@canonical/launchpad-design-tokens) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@canonical/launchpad-design-tokens
Design tokens for Canonical's Launchpad, providing consistent styling across the platform. This package generates CSS custom properties and Figma tokens from a centralized token system.
Installation
npm install @canonical/launchpad-design-tokensUsage
CSS Tokens
The package provides CSS files with custom properties for different categories:
Colors
dist/css/color/light.css- Light mode colorsdist/css/color/dark.css- Dark mode colorsdist/css/color/system.css- System preference based colors
Typography
dist/css/typography/narrow.css- Typography for narrow screensdist/css/typography/medium.css- Typography for medium screensdist/css/typography/wide.css- Typography for wide screensdist/css/typography/extraWide.css- Typography for extra wide screensdist/css/typography/responsive.css- Responsive typography system
Dimensions
dist/css/dimension/narrow.css- Dimensions for narrow screensdist/css/dimension/medium.css- Dimensions for medium screensdist/css/dimension/wide.css- Dimensions for wide screensdist/css/dimension/extraWide.css- Dimensions for extra wide screensdist/css/dimension/responsive.css- Responsive dimension system
Figma Tokens
Figma-compatible token files are available in dist/figma/ with the same structure as CSS tokens, plus manifest files for easy import.
Development
Prerequisites
- Bun - JavaScript runtime and package manager
Setup
bun installAvailable Scripts
# Build all tokens
bun run build
# Build specific categories
bun run build:color
bun run build:typography
bun run build:dimension
# Run linting and type checking
bun run check
# Fix linting issues
bun run check:fixProject Structure
src/
├── tokens/
│ ├── primitives/ # Base token values
│ └── semantic/ # Semantic token definitions
│ ├── color/
│ ├── typography/
│ └── dimension/
└── build/ # Build scripts
├── color.ts
├── typography.ts
└── dimension.tsToken Categories
Colors
- Light and dark mode support
- System preference detection
- Semantic color names for consistent theming
Typography
- Responsive font sizes and line heights
- Breakpoint-specific typography scales
- Consistent font family definitions
Dimensions
- Spacing and layout dimensions
- Responsive sizing systems
- Breakpoint-specific dimension scales
License
LGPL-3.0
Contributing
This project is maintained by the Canonical Webteam. For questions or contributions, please contact webteam@canonical.com.