Design Systems & Component Libraries · Lezione

Convenzioni di denominazione dei token e architettura a livelli

Organizzate i design token in un’architettura a livelli scalabile — token primitivi, semantici e dei componenti — usando nomi capaci di resistere ai cambiamenti.

Lezione 4 di 413 passaggi

Convenzioni di denominazione dei token e architettura a livelli è una lezione Design Systems & Component Libraries gratuita su CoddyKit. Questa è la lezione 4 di 4. Puoi leggere la lezione completa qui gratuitamente — poi esercitati direttamente nel browser con un editor di codice integrato e un tutor IA disponibile 24/7. Fa parte del percorso di apprendimento Design Systems & Component Libraries, e i tuoi progressi si sincronizzano tra il web e l'app CoddyKit. Il corso Design Systems & Component Libraries include 4 lezioni in totale.

Parti di questa lezione non sono ancora state tradotte e vengono mostrate in inglese.

Why Token Architecture Matters

A flat list of color tokens works at first, then collapses as the system grows. A tiered token architecture keeps tokens scalable and meaningful.

This lesson builds on implementing tokens by structuring and naming them well.

Tier 1: Primitive Tokens

Primitive (or global) tokens are raw values: blue-500 = #3b82f6, space-4 = 16px.

They are the full palette of available values, named by what they are, with no opinion about where they are used.

Tier 2: Semantic Tokens

Semantic (or alias) tokens describe intent: color-action-primary, color-text-danger.

They reference primitives but add meaning. Components use semantic tokens, so re-theming means repointing aliases, not editing every component.

Tier 3: Component Tokens

Component tokens scope values to a specific component: button-background-color, card-padding.

They reference semantic tokens. The chain below shows the three tiers resolving down to a raw value.

const primitive = { 'blue-500': '#3b82f6' };
const semantic = { 'color-action-primary': 'blue-500' };
const component = { 'button-bg': 'color-action-primary' };

function resolve(token) {
  let v = component[token] || semantic[token] || token;
  v = semantic[v] || v;
  return primitive[v] || v;
}

console.log(resolve('button-bg'));

The Power of Indirection

Why three tiers? Indirection. Change color-action-primary from blue to green once, and every button, link, and focus ring updates.

Without semantic tokens you would hunt down every hardcoded blue. Tiers turn sweeping changes into one edit.

Naming That Survives Change

Name semantic tokens by role, never by value. color-success survives a palette change; color-green becomes a lie.

The same rule applies to primitives - prefer blue-500 over brand-blue if the brand might shift.

A Consistent Naming Schema

Adopt a predictable pattern: category-property-variant-state, e.g. color-text-link-hover.

When every token follows the same grammar, developers can guess token names instead of searching docs. Consistency is the goal.

Avoiding Over-Tokenization

Not everything needs a token. Tokenizing every one-off value creates noise and maintenance burden.

Tokenize values that repeat or carry meaning. A truly unique magic number can stay inline with a comment.

Themes Live at the Semantic Tier

Light, dark, and brand themes differ at the semantic layer. Primitives stay constant; semantic aliases repoint per theme.

This is why the tier structure makes multi-theme support nearly free - you swap one mapping table.

Documenting the Hierarchy

Show the token chain in your docs: which primitive a semantic token points to, and which components consume it.

This transparency helps contributors choose the right tier and understand the ripple effect of a change.

Architecture That Scales

A tiered, well-named token system scales from one product to dozens of themed, white-labeled apps without rework.

The structure is the difference between tokens that empower and tokens that become technical debt.

Quick Check

Test your token architecture knowledge.

Recap

You structured design tokens into a scalable architecture:

  • Primitive tokens hold raw values.
  • Semantic tokens add intent; components reference these.
  • Component tokens scope values per component.
  • Name by role, follow a consistent schema, and avoid over-tokenizing.

Tiered tokens make sweeping design changes a single edit.

Gratis per iniziare

Impara Design Systems & Component Libraries con un tutor IA — gratis

Scrivi ed esegui vero codice nel tuo browser, ricevi aiuto istantaneo da un tutor IA disponibile 24/7, e riprendi da dove hai lasciato sul web o nell'app.

Corsi
12
Lezioni
48

Domande Frequenti

La lezione «Convenzioni di denominazione dei token e architettura a livelli» è gratuita?

Sì — il testo completo di «Convenzioni di denominazione dei token e architettura a livelli» è gratuito qui sul web. Per esercitarvi in modo interattivo (un editor di codice integrato e un tutor IA 24/7) e sbloccare il resto del corso Design Systems & Component Libraries, passa a CoddyKit PRO. Il corso Design Systems & Component Libraries include 4 lezioni in totale.

Cosa imparerò in «Convenzioni di denominazione dei token e architettura a livelli»?

Organizzate i design token in un’architettura a livelli scalabile — token primitivi, semantici e dei componenti — usando nomi capaci di resistere ai cambiamenti. Eserciti Design Systems & Component Libraries con codice pratico che esegui direttamente nel browser, e un tutor IA 24/7 risponde alle tue domande mentre lavori sulla lezione.

Ho bisogno di esperienza per iniziare Design Systems & Component Libraries?

Non è richiesta alcuna esperienza precedente. Design Systems & Component Libraries su CoddyKit è strutturato per principianti e studenti avanzati, quindi puoi iniziare da qui o dall'inizio e procedere al tuo ritmo. Questa è la lezione 4 di 4.

Quanto tempo richiede la lezione «Convenzioni di denominazione dei token e architettura a livelli»?

La maggior parte delle lezioni CoddyKit richiede circa 5–10 minuti. Ogni lezione è breve e interattiva, quindi fai progressi costanti e riprendi esattamente da dove hai lasciato su web e app.

Posso scrivere ed eseguire codice in questa lezione Design Systems & Component Libraries?

Sì. Ogni lezione Design Systems & Component Libraries include un editor di codice integrato, quindi scrivi ed esegui codice reale direttamente nel tuo browser e ricevi feedback istantaneo dall'IA — nessuna configurazione locale necessaria.

Tutte le lezioni di questo corso

  1. Cosa sono i design token?
  2. Implementazione dei design token
  3. Automazione dei flussi di lavoro dal design al codice
  4. Convenzioni di denominazione dei token e architettura a livelli
← Torna a Design Systems & Component Libraries