프레임워크n라이브러리 - ChoDragon9/posts GitHub Wiki

React

NextJs

Nuxt

RxJS

Angular

TypeScript

const semanticTokens = {
  colors: {
    'tds-canvas-bg': {
      _light: 'white',
      _dark: 'white',
    },
    'tds-canvas-text': {
      _light: 'gray.800',
      _dark: 'gray.800',
    }
  },
  colors2: {
    'tds-canvas-bg2': {
      _light: 'white',
      _dark: 'white',
    },
    'tds-canvas-text2': {
      _light: 'gray.800',
      _dark: 'gray.800',
    }
  },
};

type SemanticTokens = typeof semanticTokens;
type Keys = keyof SemanticTokens;
type ColorKeys<T extends Keys> = keyof SemanticTokens[T];
type Tokens = {
    [key in Keys]: `${key}.${string & ColorKeys<key>}`
}[Keys];

const colors: Tokens[] = [
    'colors.tds-canvas-bg',
    'colors.tds-canvas-text',
    'colors2.tds-canvas-bg2',
    'colors2.tds-canvas-text2'
];

Vite

Vue

Lodash

⚠️ **GitHub.com Fallback** ⚠️