Skip to content

Commit

Permalink
feat: customize color template
Browse files Browse the repository at this point in the history
  • Loading branch information
DaleSeo committed Jan 4, 2025
1 parent f81defa commit 561d8cd
Show file tree
Hide file tree
Showing 3 changed files with 308 additions and 441 deletions.
4 changes: 1 addition & 3 deletions src/styles/globalCss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { defineGlobalStyles } from "@pandacss/dev";
export const globalCss = defineGlobalStyles({
":root": {
"--global-font-body": "var(--fonts-sans)",
"&.dark": {
backgroundColor: "black",
},
backgroundColor: "var(--colors-base)",
},
h1: {
fontSize: "var(--font-sizes-4xl)", // 2.25rem
Expand Down
194 changes: 45 additions & 149 deletions src/tokens/colors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,76 +3,21 @@ import { colors, semanticColors } from "./colors.ts";

# Colors

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

๋‹ฌ๋ ˆ UI์˜ ๊ฐœ์„ฑ์„ ๋‚˜ํƒ€๋‚ด๋Š” ์ƒ‰์ƒ์ž…๋‹ˆ๋‹ค
๋‹ฌ๋ ˆ 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"
title="์ดˆ๋ก"
subtitle="colors.teal"
colors={Object.fromEntries(
Object.entries(colors.fuchsia).map(([name, { value }]) => [name, value])
Object.entries(colors.teal).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="ํผํ”Œ"
subtitle="colors.purple"
title="์ดˆ๋ก (dark)"
subtitle="colors.tealDark"
colors={Object.fromEntries(
Object.entries(colors.purple).map(([name, { value }]) => [name, value])
Object.entries(colors.tealDark).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
Expand All @@ -83,122 +28,73 @@ TailwindCSS์˜ ์ƒ‰์ƒ ํŒ”๋ ˆํŠธ๋ฅผ ๊ทธ๋Œ€๋กœ ์ฐจ์šฉํ•ฉ๋‹ˆ๋‹ค.
)}
/>
<ColorItem
title="์ธ๋””๊ณ "
subtitle="colors.indigo"
title="๋ณด๋ผ (dark)"
subtitle="colors.violetDark"
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])
Object.entries(colors.violetDark).map(([name, { value }]) => [
name,
value,
])
)}
/>
<ColorItem
title="๋ ˆ๋“œ"
title="๋นจ๊ฐ•"
subtitle="colors.red"
colors={Object.fromEntries(
Object.entries(colors.red).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="๋„ค์ธ„๋Ÿด"
subtitle="colors.neutral"
title="๋นจ๊ฐ• (dark)"
subtitle="colors.redDark"
colors={Object.fromEntries(
Object.entries(colors.neutral).map(([name, { value }]) => [name, value])
Object.entries(colors.redDark).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="์Šคํ†ค"
subtitle="colors.stone"
title="๋…ธ๋ž‘"
subtitle="colors.yellow"
colors={Object.fromEntries(
Object.entries(colors.stone).map(([name, { value }]) => [name, value])
Object.entries(colors.yellow).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="์ง•ํฌ"
subtitle="colors.zinc"
title="๋…ธ๋ž‘ (dark)"
subtitle="colors.yellowDark"
colors={Object.fromEntries(
Object.entries(colors.zinc).map(([name, { value }]) => [name, value])
Object.entries(colors.yellowDark).map(([name, { value }]) => [
name,
value,
])
)}
/>
<ColorItem
title="๊ทธ๋ ˆ์ด"
title="ํšŒ์ƒ‰"
subtitle="colors.gray"
colors={Object.fromEntries(
Object.entries(colors.gray).map(([name, { value }]) => [name, value])
)}
/>
<ColorItem
title="์Šฌ๋ ˆ์ดํŠธ"
subtitle="colors.slate"
title="ํšŒ์ƒ‰ (dark)"
subtitle="colors.grayDark"
colors={Object.fromEntries(
Object.entries(colors.slate).map(([name, { value }]) => [name, value])
Object.entries(colors.grayDark).map(([name, { value }]) => [name, value])
)}
/>
</ColorPalette>

์šฉ๋„์— ๋”ฐ๋ผ์„œ ๊ฐ ์ƒ‰์ƒ์€ 12๊ฐ€์ง€ ์Šค์ผ€์ผ๋กœ ๋ถ„๋ฆฌ๋ฉ๋‹ˆ๋‹ค.

- Scale 1: ํŽ˜์ด์ง€ ๋ฐฐ๊ฒฝ
- Scale 2: ์˜ˆ๋น„
- Scale 3: ์ปดํฌ๋„ŒํŠธ ๋ฐฐ๊ฒฝ
- Scale 4: ์ปดํฌ๋„ŒํŠธ ๋ฐฐ๊ฒฝ (hover)
- Scale 5: ์ปดํฌ๋„ŒํŠธ ๋ฐฐ๊ฒฝ (active)
- Scale 6: ์˜ˆ๋น„
- Scale 7: ๊ฒฝ๊ณ„
- Scale 8: ๊ฒฝ๊ณ„ (hover)
- Scale 9: ์†”๋ฆฌ๋“œ ๋ฐฐ๊ฒฝ
- Scale 10: ์†”๋ฆฌ๋“œ ๋ฐฐ๊ฒฝ (hover)
- Scale 11: ๊ธ€์ž (low contrast)
- Scale 12: ๊ธ€์ž (high contrast)
Loading

0 comments on commit 561d8cd

Please sign in to comment.