Skip to content

Commit

Permalink
feat: add color tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
DaleSeo committed Dec 31, 2024
1 parent 8d08e93 commit f81defa
Show file tree
Hide file tree
Showing 4 changed files with 525 additions and 0 deletions.
5 changes: 5 additions & 0 deletions panda.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from "@pandacss/dev";
import { globalCss } from "./src/styles/globalCss";
import { colors, semanticColors } from "./src/tokens/colors";
import {
textStyles,
fonts,
Expand Down Expand Up @@ -30,12 +31,16 @@ export default defineConfig({
extend: {
textStyles,
tokens: {
colors,
fonts,
fontWeights,
fontSizes,
letterSpacings,
lineHeights,
},
semanticTokens: {
colors: semanticColors,
},
},
},

Expand Down
3 changes: 3 additions & 0 deletions src/styles/globalCss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { defineGlobalStyles } from "@pandacss/dev";
export const globalCss = defineGlobalStyles({
":root": {
"--global-font-body": "var(--fonts-sans)",
"&.dark": {
backgroundColor: "black",
},
},
h1: {
fontSize: "var(--font-sizes-4xl)", // 2.25rem
Expand Down
204 changes: 204 additions & 0 deletions src/tokens/colors.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
import { Meta, ColorPalette, ColorItem } from "@storybook/blocks";
import { colors, semanticColors } from "./colors.ts";

# Colors

## ์‹œ๋ฉ˜ํ‹ฑ ์ƒ‰์ƒ

๋‹ฌ๋ ˆ UI์˜ ๊ฐœ์„ฑ์„ ๋‚˜ํƒ€๋‚ด๋Š” ์ƒ‰์ƒ์ž…๋‹ˆ๋‹ค

<ColorPalette>
<ColorItem
title="์ฃผ์š”์ƒ‰"
subtitle="semanticColors.primary"
colors={{
primary: semanticColors.primary.value,
}}
/>
<ColorItem
title="๋ณด์กฐ์ƒ‰"
subtitle="semanticColors.secondary"
colors={{
secondary: semanticColors.secondary.value,
}}
/>
<ColorItem
title="๋ฐฐ๊ฒฝ์ƒ‰"
subtitle="semanticColors.bg"
colors={Object.fromEntries(
Object.entries(semanticColors.bg).map(([name, { value }]) => [
name,
value,
])
)}
/>
<ColorItem
title="๊ธ€์ž์ƒ‰"
subtitle="semanticColors.text"
colors={{
light: semanticColors.text.value.base,
dark: semanticColors.text.value._dark,
}}
/>
</ColorPalette>

## ์ƒ‰์ƒ ํŒ”๋ ˆํŠธ

TailwindCSS์˜ ์ƒ‰์ƒ ํŒ”๋ ˆํŠธ๋ฅผ ๊ทธ๋Œ€๋กœ ์ฐจ์šฉํ•ฉ๋‹ˆ๋‹ค.

<ColorPalette>
<ColorItem
title="๋กœ์ฆˆ"
subtitle="colors.rose"
colors={Object.fromEntries(
Object.entries(colors.rose).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="ํ•‘ํฌ"
subtitle="colors.pink"
colors={Object.fromEntries(
Object.entries(colors.pink).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="ํ‘ธํฌ์‹œ์•„"
subtitle="colors.fuchsia"
colors={Object.fromEntries(
Object.entries(colors.fuchsia).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="ํผํ”Œ"
subtitle="colors.purple"
colors={Object.fromEntries(
Object.entries(colors.purple).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="๋ณด๋ผ"
subtitle="colors.violet"
colors={Object.fromEntries(
Object.entries(colors.violet).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="์ธ๋””๊ณ "
subtitle="colors.indigo"
colors={Object.fromEntries(
Object.entries(colors.indigo).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="๋ธ”๋ฃจ"
subtitle="colors.blue"
colors={Object.fromEntries(
Object.entries(colors.blue).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="์Šค์นด์ด"
subtitle="colors.sky"
colors={Object.fromEntries(
Object.entries(colors.sky).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="์‹ธ์ด์–ธ"
subtitle="colors.cyan"
colors={Object.fromEntries(
Object.entries(colors.cyan).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="ํ‹ธ"
subtitle="colors.teal"
colors={Object.fromEntries(
Object.entries(colors.teal).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="์—๋จธ๋ž„๋“œ"
subtitle="colors.emerald"
colors={Object.fromEntries(
Object.entries(colors.emerald).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="๊ทธ๋ฆฐ"
subtitle="colors.green"
colors={Object.fromEntries(
Object.entries(colors.green).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="๋ผ์ž„"
subtitle="colors.lime"
colors={Object.fromEntries(
Object.entries(colors.lime).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="์˜๋กœ์šฐ"
subtitle="colors.yellow"
colors={Object.fromEntries(
Object.entries(colors.yellow).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="์•ฐ๋ฒ„"
subtitle="colors.amber"
colors={Object.fromEntries(
Object.entries(colors.amber).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="์˜ค๋ Œ์ง€"
subtitle="colors.orange"
colors={Object.fromEntries(
Object.entries(colors.orange).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="๋ ˆ๋“œ"
subtitle="colors.red"
colors={Object.fromEntries(
Object.entries(colors.red).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="๋„ค์ธ„๋Ÿด"
subtitle="colors.neutral"
colors={Object.fromEntries(
Object.entries(colors.neutral).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="์Šคํ†ค"
subtitle="colors.stone"
colors={Object.fromEntries(
Object.entries(colors.stone).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="์ง•ํฌ"
subtitle="colors.zinc"
colors={Object.fromEntries(
Object.entries(colors.zinc).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="๊ทธ๋ ˆ์ด"
subtitle="colors.gray"
colors={Object.fromEntries(
Object.entries(colors.gray).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="์Šฌ๋ ˆ์ดํŠธ"
subtitle="colors.slate"
colors={Object.fromEntries(
Object.entries(colors.slate).map(([name, { value }]) => [name, value])
)}
/>
</ColorPalette>
Loading

0 comments on commit f81defa

Please sign in to comment.