Design tokens are the foundational building blocks of Aggarly Platform. They define colors, spacing, typography, radius, shadows, and layering in a consistent, scalable, and theme-aware way.
Tokens are authored once and compiled into multiple runtime formats. This ensures a single source of truth while supporting both SCSS authoring and runtime theming via CSS variables.
source-tokens.ts.// src/design-system/scss/tokens/source-tokens.ts
export const baseTokens = {
"color-primary": {
value: "#6366f1",
type: "color",
group: "Brand",
label: "Primary"
},
"space-4": {
value: "16px",
type: "size",
group: "Spacing"
}
};Whenever token values change, the token compiler must be run to regenerate CSS variables and SCSS token references.
npm run tokens:buildApplication and component styles must consume tokens exclusively through the generated SCSS token variables.
@use "@/design-system/scss/tokens" as tokens;
.button {
background: tokens.$color-primary;
border-radius: tokens.$radius-md;
padding: tokens.$space-2 tokens.$space-4;
}