Skip to content

Commit 6caf1f4

Browse files
committed
docs: 프로그램, css 가이드 추가
1 parent b30385a commit 6caf1f4

18 files changed

Lines changed: 1788 additions & 7 deletions

File tree

docs/plugin/_meta.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
export default {
2+
index: {
3+
title: "소개",
4+
theme: {
5+
breadcrumb: false,
6+
},
7+
},
8+
"---guide": {
9+
type: "separator",
10+
title: "기본 가이드",
11+
},
12+
guide: "프로그램 가이드",
13+
"custom-css": "커스텀 CSS",
14+
"---plugin": {
15+
type: "separator",
16+
title: "플러그인 시스템",
17+
},
218
"getting-started": "시작하기",
319
"declarative-api": "선언형 API",
420
"template-syntax": "템플릿 문법",

docs/plugin/custom-css/_meta.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
index: "소개",
3+
"key-styling": "키 스타일링",
4+
"counter-styling": "카운터 스타일링",
5+
variables: "CSS 변수 레퍼런스",
6+
examples: "예제 모음",
7+
};
Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
---
2+
title: 카운터 스타일링
3+
description: CSS로 키 카운터의 모양과 효과를 커스터마이징하는 방법
4+
---
5+
6+
# 카운터 스타일링
7+
8+
이 가이드에서는 CSS를 사용하여 키 카운터의 모양을 커스터마이징하는 방법을 설명합니다.
9+
10+
## 기본 구조
11+
12+
카운터는 `.counter` 클래스와 `data-counter-state` 속성을 통해 상태를 나타냅니다:
13+
14+
- `data-counter-state="inactive"`: 키를 누르지 않은 상태
15+
- `data-counter-state="active"`: 키를 누르고 있는 상태
16+
17+
## 전역 카운터 스타일
18+
19+
모든 카운터에 공통으로 적용되는 스타일을 설정합니다:
20+
21+
```css
22+
.counter {
23+
/* 폰트 스타일 */
24+
font-size: 24px;
25+
font-weight: 700;
26+
27+
/* 폰트 패밀리 */
28+
font-family: "Roboto Mono", monospace;
29+
}
30+
```
31+
32+
## CSS 변수
33+
34+
카운터는 다음 CSS 변수를 지원합니다:
35+
36+
| 변수 | 설명 | 기본값 |
37+
| ------------------------ | ------------------ | ------------- |
38+
| `--counter-color` | 텍스트 색상 | `#FFFFFF` |
39+
| `--counter-stroke-color` | 텍스트 외곽선 색상 | `transparent` |
40+
| `--counter-stroke-width` | 텍스트 외곽선 두께 | `0px` |
41+
42+
## 비활성 상태 스타일
43+
44+
키를 누르지 않았을 때의 카운터 스타일입니다:
45+
46+
```css
47+
.counter[data-counter-state="inactive"] {
48+
/* 텍스트 색상 */
49+
--counter-color: #474244;
50+
51+
/* 외곽선 비활성화 */
52+
--counter-stroke-color: transparent;
53+
}
54+
```
55+
56+
## 활성 상태 스타일
57+
58+
키를 누르고 있을 때의 카운터 스타일입니다:
59+
60+
```css
61+
.counter[data-counter-state="active"] {
62+
/* 텍스트 색상 */
63+
--counter-color: #ff2b80;
64+
65+
/* 외곽선 */
66+
--counter-stroke-color: transparent;
67+
68+
/* 글로우 효과 */
69+
text-shadow: 0px 0px 3px #ff2b80;
70+
}
71+
```
72+
73+
## 특정 키의 카운터 스타일
74+
75+
클래스 선택자를 조합하여 특정 키의 카운터만 다르게 스타일링할 수 있습니다.
76+
77+
### 예제: 파란색 키의 카운터
78+
79+
```css
80+
/* .blue 클래스를 가진 키의 카운터 - 비활성 상태 */
81+
.blue .counter[data-counter-state="inactive"] {
82+
--counter-color: #1a4a5c;
83+
}
84+
85+
/* .blue 클래스를 가진 키의 카운터 - 활성 상태 */
86+
.blue .counter[data-counter-state="active"] {
87+
--counter-color: #2ebef3;
88+
--counter-stroke-color: transparent;
89+
text-shadow: 0px 0px 3px #2ebef3;
90+
}
91+
```
92+
93+
<Callout type="info">
94+
클래스 조합을 사용하면 키와 카운터의 색상을 일치시켜 통일감 있는 디자인을 만들
95+
수 있습니다.
96+
</Callout>
97+
98+
## 스타일 예제
99+
100+
### 네온 글로우 스타일
101+
102+
```css
103+
.counter {
104+
font-size: 20px;
105+
font-weight: 700;
106+
}
107+
108+
.counter[data-counter-state="inactive"] {
109+
--counter-color: #333;
110+
}
111+
112+
.counter[data-counter-state="active"] {
113+
--counter-color: #00ff88;
114+
text-shadow: 0px 0px 2px #00ff88, 0px 0px 4px #00ff88, 0px 0px 8px #00ff88;
115+
}
116+
```
117+
118+
### 외곽선 스타일
119+
120+
```css
121+
.counter {
122+
font-size: 28px;
123+
font-weight: 900;
124+
}
125+
126+
.counter[data-counter-state="inactive"] {
127+
--counter-color: #fff;
128+
--counter-stroke-color: #333;
129+
--counter-stroke-width: 2px;
130+
}
131+
132+
.counter[data-counter-state="active"] {
133+
--counter-color: #fff;
134+
--counter-stroke-color: #ff2b80;
135+
--counter-stroke-width: 2px;
136+
}
137+
```
138+
139+
### 미니멀 스타일
140+
141+
```css
142+
.counter {
143+
font-size: 14px;
144+
font-weight: 400;
145+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
146+
}
147+
148+
.counter[data-counter-state="inactive"] {
149+
--counter-color: #999;
150+
}
151+
152+
.counter[data-counter-state="active"] {
153+
--counter-color: #333;
154+
}
155+
```
156+
157+
### 레인보우 그라데이션 스타일
158+
159+
```css
160+
.counter[data-counter-state="active"] {
161+
background: linear-gradient(
162+
45deg,
163+
#ff2b80,
164+
#ff8c00,
165+
#ffee00,
166+
#00ff88,
167+
#00bfff,
168+
#8b5cf6
169+
);
170+
background-size: 300% 300%;
171+
-webkit-background-clip: text;
172+
-webkit-text-fill-color: transparent;
173+
animation: rainbow 2s ease infinite;
174+
}
175+
176+
@keyframes rainbow {
177+
0% {
178+
background-position: 0% 50%;
179+
}
180+
50% {
181+
background-position: 100% 50%;
182+
}
183+
100% {
184+
background-position: 0% 50%;
185+
}
186+
}
187+
```
188+
189+
## 키와 카운터 색상 맞추기
190+
191+
키와 카운터 색상을 일관되게 유지하는 예제입니다:
192+
193+
```css
194+
/* 기본 키 - 핑크 테마 */
195+
[data-state="active"] {
196+
--key-border: 3px solid #ff2b80;
197+
--key-text-color: #ff2b80;
198+
text-shadow: 0px 0px 3px #ff2b80;
199+
}
200+
201+
.counter[data-counter-state="active"] {
202+
--counter-color: #ff2b80;
203+
text-shadow: 0px 0px 3px #ff2b80;
204+
}
205+
206+
/* 파란색 키 - 블루 테마 */
207+
.blue[data-state="active"] {
208+
--key-border: 3px solid #2ebef3;
209+
--key-text-color: #2ebef3;
210+
text-shadow: 0px 0px 3px #2ebef3;
211+
}
212+
213+
.blue .counter[data-counter-state="active"] {
214+
--counter-color: #2ebef3;
215+
text-shadow: 0px 0px 3px #2ebef3;
216+
}
217+
```
218+
219+
## 고급 팁
220+
221+
### 숫자 폰트 최적화
222+
223+
카운터 숫자가 변경될 때 레이아웃이 흔들리지 않도록 고정폭 숫자를 사용합니다:
224+
225+
```css
226+
.counter {
227+
font-variant-numeric: tabular-nums;
228+
font-feature-settings: "tnum";
229+
}
230+
```
231+
232+
### 카운터 크기 제한
233+
234+
큰 숫자에서도 레이아웃이 깨지지 않도록 최소/최대 너비를 설정합니다:
235+
236+
```css
237+
.counter {
238+
min-width: 30px;
239+
text-align: center;
240+
}
241+
```

0 commit comments

Comments
 (0)