@gtcx/tokens
v0.3.0
Published
GTCX design tokens — primitives, semantic, platform, and dark theme
Downloads
40
Readme
@gtcx/tokens
Ledger design tokens for enterprise and Global-South-first product surfaces.
This package provides:
- primitive values
- semantic UI tokens
- operational trust and connectivity tokens
- density and motion presets
- platform token packs
- CSS variable generation utilities
Install
pnpm add @gtcx/tokensCore Usage
import {
semanticColors,
semanticTrust,
semanticConnectivity,
semanticDensity,
semanticMotion,
} from '@gtcx/tokens';
semanticColors.primary;
semanticTrust.verification.verified;
semanticConnectivity.syncing;
semanticDensity.field.touchTargetMin;
semanticMotion.reduced.durationNormal;Platform Packs
import { fiftyFourPlatformTokens, fieldPlatformTokens } from '@gtcx/tokens';Direct subpath imports are also supported:
import { fiftyFourPlatformTokens } from '@gtcx/tokens/platforms/fifty-four';
import { fieldPlatformTokens } from '@gtcx/tokens/platforms/field';Theme Factory
import { brands, createTheme, createThemeCSS } from '@gtcx/tokens';
const theme = createTheme(brands.gtcx);
const css = createThemeCSS(brands.agx);CSS Utility
import { generateCSSVariables } from '@gtcx/tokens/css';
import { fieldPlatformTokens } from '@gtcx/tokens/platforms/field';
const css = generateCSSVariables(fieldPlatformTokens);Export Surface
Primitives
colorPrimitivesspacingPrimitivesfontSizePrimitivesfontWeightPrimitiveslineHeightPrimitivesborderRadiusPrimitivesshadowPrimitivesmotionPrimitives
Semantic Families
semanticColorssemanticSpacingsemanticTypographysemanticRadiisemanticShadowssemanticLayoutsemanticTrustsemanticConnectivitysemanticDensitysemanticMotion
Themes And Platforms
darkSemanticColorsbrandscreateThemecreateThemeCSSfiftyFourPlatformTokensfieldPlatformTokens
Token Model
Ledger tokens follow this chain:
primitives -> semantic -> platform overrides -> theme/css outputConsumers should prefer semantic tokens over primitives unless they are working on the token system itself.
Requirements
- Node.js >= 20
