- 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: ํ๋ฉด ๊ตฌํ ์ฐธ๊ณ ์ฉ ๊ตฌ์กฐ ๋ฐ์ดํฐ