Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@

## [Unreleased]

### Fixed

- **`semantic.css` ์— `@variant light` ๋ธ”๋ก์„ ๋˜์‚ด๋ ธ๋‹ค.** 0.0.10 ์€ light ๊ฐ’์„ `@theme static` ์—๋งŒ ๋‘์–ด
Uniwind ๊ฐ€ ๋ถ€ํŒ… ๋•Œ `Theme light is missing variable --color-โ€ฆ` ๋ฅผ ๋ƒˆ๋‹ค. ์˜๋ฏธ ํ† ํฐ์€ ๋“ฑ๋กยทlightยทdark
์„ธ ๋ธ”๋ก์— ๊ฐ™์ด ๋„ฃ๋Š”๋‹ค โ€” `use-colors.test` ๊ฐ€ ์…‹์˜ ์ง‘ํ•ฉ์ด ๊ฐ™์€์ง€ ๋ณธ๋‹ค

## [0.0.10] โ€” 2026-09-22

### Added
Expand Down
8 changes: 4 additions & 4 deletions docs/colors-in-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const colors = useColors();

```
src/styles/tokens/colors.css @theme static โ€” ์›์‹œ์ƒ‰
src/styles/tokens/semantic.css @theme static โ€” ์˜๋ฏธ ํ† ํฐ ๋“ฑ๋ก + light ๊ฐ’
@layer theme { :root { @variant dark { โ€ฆ } } } โ€” dark ๊ฐ’
src/styles/tokens/semantic.css @theme static โ€” ์˜๋ฏธ ํ† ํฐ ๋“ฑ๋ก(๊ฐ’์€ light ์™€ ๊ฐ™์Œ)
@layer theme { :root { @variant light { โ€ฆ } @variant dark { โ€ฆ } } } โ€” ํ…Œ๋งˆ๋ณ„ ๊ฐ’
src/lib/theme/use-colors.ts useColors() โ€” TOKENS ํ‘œ ํ•˜๋‚˜, useCSSVariable ๋ฐฐ์—ด ์ฝ๊ธฐ
src/lib/theme/use-colors.test.ts ์ด๋ฆ„ ๊ฒ€์ฆ
```
Expand Down Expand Up @@ -61,7 +61,7 @@ export function useColors(): Colors {
## ์ƒ‰์„ ์ถ”๊ฐ€ํ•  ๋•Œ

1. ์›์‹œ์ƒ‰์ด๋ฉด `colors.css`์— `--color-<์ด๋ฆ„>: #hex`.
2. ์˜๋ฏธ ํ† ํฐ์ด๋ฉด `semantic.css`์˜ `@theme static`(light)๊ณผ `@variant dark` **๋‘˜ ๋‹ค**์— ์›์‹œ์ƒ‰ ์ฐธ์กฐ๋กœ ์ ๋Š”๋‹ค.
2. ์˜๋ฏธ ํ† ํฐ์ด๋ฉด `semantic.css`์˜ `@theme static`(๋“ฑ๋ก), `@variant light`, `@variant dark` **์„ธ ๊ณณ ๋ชจ๋‘**์— ์›์‹œ์ƒ‰ ์ฐธ์กฐ๋กœ ์ ๋Š”๋‹ค. ํ•˜๋‚˜๋ผ๋„ ๋น ์ง€๋ฉด Uniwind ๊ฐ€ ๋ถ€ํŒ… ๋•Œ `Theme light is missing variable` ์„ ๋‚ธ๋‹ค.
3. JS์—์„œ๋„ ์“ฐ๋ฉด `use-colors.ts`์˜ `TOKENS`์— ํ•œ ์ค„ ์ถ”๊ฐ€ํ•œ๋‹ค.

## ๊ฐ€๋“œ๋ ˆ์ผ
Expand Down Expand Up @@ -134,5 +134,5 @@ ESLint ๊ทœ์น™์ด ์‚ด์•„ ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š” ํ…Œ์ŠคํŠธ(`eslint.config.test.ts`
## ๊ฒ€์ฆ

- `pnpm run check-all`.
- ๋ฒˆ๋“ค: `npx expo export --platform android --no-bytecode --output-dir <์ž„์‹œ๊ฒฝ๋กœ>` ๋’ค ๋ฒˆ๋“ค์— `"__uniwind-theme-dark":{"--color-background":โ€ฆ}`(dark ํ‘œ)์™€ ๊ธฐ๋ณธ ํ‘œ์˜ `"--color-background":โ€ฆ`(light)๊ฐ€ ๋‘˜ ๋‹ค ์žˆ๋Š”์ง€ ๋ณธ๋‹ค.
- ๋ฒˆ๋“ค: `npx expo export --platform android --no-bytecode --output-dir <์ž„์‹œ๊ฒฝ๋กœ>` ๋’ค ๋ฒˆ๋“ค์— `"__uniwind-theme-light"` ์™€ `"__uniwind-theme-dark"` ํ‘œ๊ฐ€ ๋‘˜ ๋‹ค ์žˆ๊ณ  ๊ฐ๊ฐ์— ํ† ํฐ์ด ์ „๋ถ€ ์žˆ๋Š”์ง€ ๋ณธ๋‹ค.
- jest์—์„œ๋Š” Metro ๋ณ€ํ™˜์ด ์•ˆ ๋Œ์•„ `useCSSVariable` ๊ฐ’์ด ๋น„์–ด ์žˆ๋‹ค. ์ƒ‰ ๊ฐ’ ์ž์ฒด๋ฅผ ๊ฒ€์ฆํ•˜๋Š” ํ…Œ์ŠคํŠธ๋Š” ์“ธ ์ˆ˜ ์—†๊ณ  ์“ธ ํ•„์š”๋„ ์—†๋‹ค.
8 changes: 5 additions & 3 deletions src/lib/theme/use-colors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ describe('useColors', () => {
expect(primitives + semantic).not.toMatch(/@theme\s*\{/);
});

it('dark ๋Š” light ์™€ ๊ฐ™์€ ์˜๋ฏธ ํ† ํฐ ์ง‘ํ•ฉ์ด๋‹ค โ€” ํ•œ์ชฝ์—๋งŒ ์ถ”๊ฐ€ํ•˜๋ฉด ๋‹ค๋ฅธ ํ…Œ๋งˆ์—์„œ ๊ฐ’์ด ๋นˆ๋‹ค', () => {
const light = block(semantic, /@theme static \{/).sort();
it('๋“ฑ๋กยทlightยทdark ๊ฐ€ ๊ฐ™์€ ์˜๋ฏธ ํ† ํฐ ์ง‘ํ•ฉ์ด๋‹ค โ€” ์–ด๊ธ‹๋‚˜๋ฉด Uniwind ๊ฐ€ ๋ถ€ํŒ… ๋•Œ "missing variable" ์„ ๋‚ธ๋‹ค', () => {
const registered = block(semantic, /@theme static \{/).sort();
const light = block(semantic, /@variant light \{/).sort();
const dark = block(semantic, /@variant dark \{/).sort();
expect(dark).toEqual(light);
expect(light).toEqual(registered);
expect(dark).toEqual(registered);
});
});
24 changes: 22 additions & 2 deletions src/styles/tokens/semantic.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ์˜๋ฏธ ํ† ํฐ. light ๊ฐ’์€ @theme static, dark ๋Š” ์•„๋ž˜์—์„œ ๊ฐ’๋งŒ ๋ฐ”๊พผ๋‹ค โ€” ํ™”๋ฉด ์ฝ”๋“œ์— dark: ๋ฅผ ์“ฐ์ง€ ์•Š๋Š”๋‹ค.
* ๊ฐ’์€ ์›์‹œ์ƒ‰ ์ฐธ์กฐ๋งŒ. ํ† ํฐ์€ ๋‘ ๋ธ”๋ก์— ๊ฐ™์ด ๋„ฃ๋Š”๋‹ค(use-colors.test ๊ฐ€ ๋ณธ๋‹ค). */
/* ์˜๋ฏธ ํ† ํฐ. @theme static ์€ ๋“ฑ๋ก(๊ฐ’์€ light ์™€ ๊ฐ™์Œ), ํ…Œ๋งˆ๋ณ„ ๊ฐ’์€ @variant lightยทdark โ€” ํ™”๋ฉด ์ฝ”๋“œ์— dark: ๋ฅผ ์“ฐ์ง€ ์•Š๋Š”๋‹ค.
* Uniwind ๋Š” ๋ถ€ํŒ… ๋•Œ lightยทdark ํ‘œ์˜ ๋ณ€์ˆ˜ ์ง‘ํ•ฉ์„ ๋น„๊ตํ•œ๋‹ค. ํ† ํฐ์€ ์„ธ ๋ธ”๋ก์— ๊ฐ™์ด ๋„ฃ๋Š”๋‹ค(use-colors.test ๊ฐ€ ๋ณธ๋‹ค). */
@theme static {
--color-background: var(--color-white);
--color-foreground: var(--color-black);
Expand All @@ -22,6 +22,26 @@

@layer theme {
:root {
@variant light {
--color-background: var(--color-white);
--color-foreground: var(--color-black);
--color-card: var(--color-white);
--color-muted: var(--color-gray-100);
--color-muted-foreground: var(--color-gray-500);

--color-primary: var(--color-gray-900);
--color-primary-foreground: var(--color-gray-50);

--color-success: var(--color-green-500);
--color-warning: var(--color-amber-600);
--color-destructive: var(--color-red-600);

--color-border: var(--color-gray-200);

--color-tab-active: var(--color-gray-700);
--color-tab-inactive: var(--color-gray-300);
}

@variant dark {
--color-background: var(--color-black);
--color-foreground: var(--color-gray-50);
Expand Down
Loading