Skip to content

POC: Semantic token layer (Less variables) #11416

Closed
lokesh wants to merge 6 commits intointernetarchive:masterfrom
lokesh:poc/less-reorg
Closed

POC: Semantic token layer (Less variables) #11416
lokesh wants to merge 6 commits intointernetarchive:masterfrom
lokesh:poc/less-reorg

Conversation

@lokesh
Copy link
Collaborator

@lokesh lokesh commented Nov 4, 2025

Example of two-tier design token system.

Primitives (raw values)
A small, curated set of base values that work well together. Constraining the palette ensures visual harmony and prevents arbitrary values from creeping into the system.

Semantic Tokens (design intent)
These map design intent to specific primitives. They’re referenced throughout the app, and their names communicate where they should be used. This provides a single point of control for updating categories of components.

As an example, if we wanted to increased the border radius of larger components, this becomes trivial: change @radius-card from @radius-lg to @radius-xl, and all card-like components update consistently. Do the same for @radius-container etc.

// PRIMITIVES FOR RADIUS
// Border radius design tokens
@radius-sm: 2px;
@radius-md: 4px;
@radius-lg: 8px;
@radius-xl: 16px;
@radius-xxl: 32px;
@radius-full: 100%;
// SEMANTIC RADIUS VARIABLES
@radius-button: @radius-md;       // buttons, tabs, pills
@radius-input: @radius-md;        // inputs, textareas
@radius-card: @radius-lg;         // cards, panels
@radius-container: @radius-lg;    // containers, wrappers
@radius-overlay: @radius-xl;      // dialogs, modals
@radius-badge: @radius-sm;        // badges, tags
@radius-notification: @radius-lg; // notifications, alerts
@radius-pill: @radius-full;       // pills, tags
@radius-avatar: @radius-full;     // avatars, profile pictures

Note: This reorganization works before or after a LESS → CSS custom-property migration. We can promote the tokens to CSS variables with minimal effort.

Stakeholders

@mekarpeles cc: @cdrini

@lokesh lokesh closed this Nov 6, 2025
@lokesh lokesh changed the title Proof-of-concept: Semantic token layer (Less variables) POC: Semantic token layer (Less variables) Nov 18, 2025
@lokesh lokesh reopened this Nov 18, 2025
@mekarpeles
Copy link
Member

I really like this direction

@lokesh
Copy link
Collaborator Author

lokesh commented Nov 24, 2025

Closing as this is a PoC and not intended for merging.

@lokesh lokesh closed this Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants