• DTCG๋Š” Design Tokens Community Group์˜ ์•ฝ์ž
  • Design Token์„ ์—ฌ๋Ÿฌ ๋„๊ตฌ์™€ ํ”Œ๋žซํผ ์‚ฌ์ด์—์„œ ๊ตํ™˜ํ•˜๊ธฐ ์œ„ํ•œ ํ‘œ์ค€ํ™” JSON ํฌ๋งท
  • Pencil, Figma, Tokens Studio, Style Dictionary ๊ฐ™์€ ๋„๊ตฌ๋“ค์ด ๊ฐ™์€ ํ† ํฐ ๋ฐ์ดํ„ฐ๋ฅผ ์ดํ•ดํ•˜๋„๋ก ๋งŒ๋“ค๊ธฐ ์œ„ํ•œ ์ƒํ˜ธ์šด์šฉ์„ฑ ๊ทœ๊ฒฉ

ํ•ด๋‹น ๊ฐœ๋…์ด ํ•„์š”ํ•œ ์ด์œ 

  • ๋””์ž์ธ ๋„๊ตฌ๋งˆ๋‹ค ํ† ํฐ ์ €์žฅ ๋ฐฉ์‹์ด ๋‹ฌ๋ผ๋„ ๊ณตํ†ต JSON ํฌ๋งท์œผ๋กœ ๋ณ€ํ™˜ํ•ด ์—ฐ๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ํ•„์š”ํ•˜๋‹ค.
  • Style Dictionary ๊ฐ™์€ ๋ณ€ํ™˜ ๋„๊ตฌ๊ฐ€ ํ† ํฐ์˜ ํƒ€์ž…๊ณผ ๊ฐ’์„ ์•ˆ์ •์ ์œผ๋กœ ํ•ด์„ํ•˜๊ธฐ ์œ„ํ•ด ํ•„์š”ํ•˜๋‹ค.
  • ํŠน์ • vendor๋‚˜ ํŠน์ • ๋””์ž์ธ ํˆด์— ์ข…์†๋˜์ง€ ์•Š๊ณ  ๋””์ž์ธ ์‹œ์Šคํ…œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ณต์œ ํ•˜๊ธฐ ์œ„ํ•ด ํ•„์š”ํ•˜๋‹ค.

AS-IS

{
  "color": {
    "background": {
      "brand": {
        "value": "#ff8a65",
        "type": "color"
      }
    }
  }
}

TO-BE

{
  "color": {
    "background": {
      "brand": {
        "$value": "#ff8a65",
        "$type": "color"
      }
    }
  }
}

DTCG JSON์˜ ํ•ต์‹ฌ ํ•„๋“œ

DTCG ํฌ๋งท์€ ๋””์ž์ธ ํ† ํฐ ์†์„ฑ์— $ prefix๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค. ํ•ต์‹ฌ ํ•„๋“œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

{
  "$description": "OhMyBaby light theme tokens",
  "color": {
    "background": {
      "brand": {
        "$type": "color",
        "$value": "#ff8a65",
        "$description": "Primary brand background color"
      }
    }
  },
  "dimension": {
    "card": {
      "radius": {
        "$type": "dimension",
        "$value": "0.75rem"
      }
    }
  }
}

$type์€ ๊ฐ’์˜ ์ข…๋ฅ˜๋ฅผ ์•Œ๋ ค์ค€๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด color, dimension, fontFamily, duration, typography ๊ฐ™์€ ํƒ€์ž…์ด ์žˆ๋‹ค. ๋ณ€ํ™˜ ๋„๊ตฌ๋Š” ์ด ํƒ€์ž…์„ ๋ณด๊ณ  ์ƒ‰์ƒ์€ Flutter Color, CSS color, Android color resource์ฒ˜๋Ÿผ ๋ฐ”๊พธ๊ณ , ํฌ๊ธฐ๋Š” dp/sp/px/double์ฒ˜๋Ÿผ ํ”Œ๋žซํผ์— ๋งž๊ฒŒ ๋ฐ”๊พผ๋‹ค.

$value๋Š” ์‹ค์ œ ๊ฐ’์ด๋‹ค. ์ด ๊ฐ’์€ ์›์‹œ๊ฐ’์ผ ์ˆ˜๋„ ์žˆ๊ณ  ๋‹ค๋ฅธ ํ† ํฐ์„ ์ฐธ์กฐํ•  ์ˆ˜๋„ ์žˆ๋‹ค.

DTCG์™€ Style Dictionary์˜ ๊ด€๊ณ„

DTCG๋Š” ํฌ๋งท์ด๊ณ , Style Dictionary๋Š” ๊ทธ ํฌ๋งท์„ ์ฝ์–ด ํ”Œ๋žซํผ๋ณ„ ์‚ฐ์ถœ๋ฌผ์„ ๋งŒ๋“œ๋Š” ๋„๊ตฌ๋‹ค. ๋‘˜์€ ๊ฐ™์€ ๊ฒƒ์ด ์•„๋‹ˆ๋‹ค.

sequenceDiagram
    autonumber
    participant Figma as Figma or Pencil
    participant DTCG as DTCG Token JSON
    participant SD as Style Dictionary
    participant Platform as Flutter CSS iOS Android
    Figma->>DTCG: ๋„๊ตฌ๋ณ„ exporter ๋˜๋Š” extractor๋กœ ์ •๊ทœํ™”
    DTCG->>SD: ํ‘œ์ค€ ํ† ํฐ ์ž…๋ ฅ
    SD->>Platform: ํ”Œ๋žซํผ๋ณ„ ์ฝ”๋“œ ์ƒ์„ฑ

ํ˜„์žฌ ํ”„๋กœ์ ํŠธ์—์„œ๋Š” Style Dictionary ์„ค์ •์— usesDtcg: true๊ฐ€ ๋“ค์–ด๊ฐ€ ์žˆ๋‹ค. ์ด ์„ค์ •์€ ์ž…๋ ฅ token JSON์„ DTCG ๋ฐฉ์‹์œผ๋กœ ํ•ด์„ํ•˜๊ฒ ๋‹ค๋Š” ์˜๋ฏธ๋‹ค.

DTCG์™€ screen spec JSON์˜ ์ฐจ์ด

DTCG๋Š” ๋””์ž์ธ ํ† ํฐ ํฌ๋งท์ด๋‹ค. ์ƒ‰์ƒ, ํฌ๊ธฐ, ๊ธ€๊ผด ๊ฐ™์€ ์Šคํƒ€์ผ ๊ฒฐ์ •์„ ํ‘œํ˜„ํ•œ๋‹ค. ๋ฐ˜๋ฉด screen spec JSON์€ ํ™”๋ฉด ๊ตฌ์กฐ๋ฅผ ํ‘œํ˜„ํ•œ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด frame, children, layout, padding, text content, icon ๊ฐ™์€ ์ •๋ณด๋Š” screen spec์— ๋“ค์–ด๊ฐ€์ง€๋งŒ Style Dictionary๊ฐ€ ๋ณ€ํ™˜ํ•˜๋Š” DTCG token JSON๊ณผ๋Š” ๋ชฉ์ ์ด ๋‹ค๋ฅด๋‹ค.

๋”ฐ๋ผ์„œ ํ˜„์žฌ ํ”„๋กœ์ ํŠธ์—์„œ ๊ตฌ๋ถ„์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

DTCG token JSON: Style Dictionary ์ž…๋ ฅ
screen spec JSON: ํ™”๋ฉด ๊ตฌํ˜„ ์ฐธ๊ณ ์šฉ ๊ตฌ์กฐ ๋ฐ์ดํ„ฐ

์ฐธ๊ณ  ๋ฌธ์„œ