Skip to content

Commit 229fb93

Browse files
committed
docs: fix core concepts documentation
- Fix RGB/RGBA to Hex conversion examples in optimize-css - Add Typography Responsive section and tsconfig.json file
1 parent eb390f4 commit 229fb93

File tree

2 files changed

+45
-9
lines changed
  • apps/landing/src/app/(detail)/docs
    • core-concepts/optimize-css
    • figma-and-theme-integration/devup-json

2 files changed

+45
-9
lines changed

apps/landing/src/app/(detail)/docs/core-concepts/optimize-css/page.mdx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ All RGB and RGBA color values are normalized and converted into compact hexadeci
6262
<Box bg="rgba(255, 0, 0, 0.5)" />
6363
6464
// Output
65-
<Box className="bg-red" /> // #f00
66-
<Box className="bg-red-50" /> // #ff000080
65+
<Box bg="#f00" /> // #ff0000 shortened to #f00
66+
<Box bg="#f000" /> // #ff000080 shortened to #f000
6767
```
6868

6969
### **Hex Shortening**
@@ -88,11 +88,11 @@ Alpha channel optimization removes unnecessary opacity information.
8888
Fully opaque colors (FF) are shortened, while partial transparency values are preserved for accuracy.
8989

9090
```tsx
91-
// Full opacity is removed
92-
// #ff0000ff → #ff0000
91+
// Full opacity is removed and shortened to 3-digit hex
92+
// #ff0000ff → #f00
9393

94-
// Partial opacity is preserved
95-
// #ff000080 → #ff000080
94+
// Partial opacity is preserved and shortened to 4-digit hex
95+
// #ff000080 → #f000
9696
```
9797

9898
## Global CSS Optimization
@@ -101,7 +101,6 @@ Fully opaque colors (FF) are shortened, while partial transparency values are pr
101101

102102
Global CSS blocks are optimized by:
103103

104-
- **Removing comments**: `/* comment */` is stripped
105104
- **Minifying whitespace**: Multiple spaces become single spaces
106105
- **Removing semicolons**: Last property in a block doesn't need semicolon
107106

apps/landing/src/app/(detail)/docs/figma-and-theme-integration/devup-json/page.mdx

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,11 @@ Each typography definition can include.
108108
- **lineHeight**: Numeric ratio or string with unit
109109
- **letterSpacing**: Spacing with unit (`-0.03em`)
110110

111-
### **Static Typography**
111+
### **Typography Configuration**
112112

113-
For non-responsive typography, use objects.
113+
Define typography styles using objects for static values or arrays for responsive breakpoints.
114+
115+
#### **Static typography**
114116

115117
```json
116118
{
@@ -127,6 +129,39 @@ For non-responsive typography, use objects.
127129
}
128130
```
129131

132+
#### **Responsive typography**
133+
134+
Use arrays to define styles for each breakpoint.
135+
136+
```json
137+
{
138+
"theme": {
139+
"typography": {
140+
"heading": [
141+
{
142+
"fontFamily": "Pretendard",
143+
"fontWeight": 700,
144+
"fontSize": "20px",
145+
"lineHeight": 1.3
146+
},
147+
{
148+
"fontFamily": "Pretendard",
149+
"fontWeight": 700,
150+
"fontSize": "28px",
151+
"lineHeight": 1.3
152+
},
153+
{
154+
"fontFamily": "Pretendard",
155+
"fontWeight": 700,
156+
"fontSize": "32px",
157+
"lineHeight": 1.2
158+
}
159+
]
160+
}
161+
}
162+
}
163+
```
164+
130165
## Usage in Components
131166

132167
### **Color Usage**
@@ -139,6 +174,8 @@ Access colors using the `$` prefix.
139174
</Box>
140175
```
141176

177+
- To enable type autocompletion for theme values, add `"df/*.ts"` to the `include` array in your `tsconfig.json` file.
178+
142179
### **Typography Usage**
143180

144181
Apply typography styles using the `typography` prop.

0 commit comments

Comments
 (0)