@fwkui/x-css 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DICTIONARY.md +599 -0
- package/README.md +89 -2306
- package/README2.md +77 -0
- package/index.d.ts +22 -15
- package/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,2320 +1,103 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Fwkui XCSS
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
XCSS la thu vien tao CSS tu class viet tat. Ban chi can viet class tren HTML/React, thu vien se tu dong sinh rule va dua vao `adoptedStyleSheets`. Tai lieu nay giup ban nho nhanh key -> property -> value de viet class dung ngay.
|
|
4
4
|
|
|
5
5
|
## Cài đặt
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```html
|
|
10
|
-
<script type="module">
|
|
11
|
-
import $ from "https://unpkg.com/@fwkui/x-css@1.0.2/index.js";
|
|
12
|
-
$.cssObserve(document);
|
|
13
|
-
</script>
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
# Hướng dẫn sử dụng xCSS
|
|
17
|
-
|
|
18
|
-
xCSS là một hệ thống CSS-in-JS cho phép bạn viết CSS ngắn gọn và hiệu quả thông qua các class name đặc biệt. Sau khi học, bạn sẽ:
|
|
19
|
-
|
|
20
|
-
- Đọc/viết class theo công thức và hiểu nó biến thành CSS như thế nào
|
|
21
|
-
- Kiểm soát **media query**, **@layer**, **!important**, **selector** giả (pseudo) và tổ hợp nhiều thuộc tính trong **một class**
|
|
22
|
-
|
|
23
|
-
> **Lưu ý**: Danh sách viết tắt thuộc tính và giá trị sẽ có ở **phần sau**.
|
|
24
|
-
|
|
25
|
-
## Cú pháp tổng quát
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
[MQ:][layer]<property><value>[@selector]
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
**Lưu ý quan trọng**: `<property><value>` là **bắt buộc** - phải có cả thuộc tính CSS và giá trị CSS.
|
|
32
|
-
|
|
33
|
-
**Ví dụ cú pháp đúng:**
|
|
34
|
-
|
|
35
|
-
- `cRed` - Màu đỏ (layer 0)
|
|
36
|
-
- `5cRed` - Màu đỏ ở layer 5
|
|
37
|
-
- `md:cRed` - Màu đỏ trên màn hình trung bình
|
|
38
|
-
- `md:5cRed` - Màu đỏ ở layer 5 trên màn hình trung bình
|
|
39
|
-
|
|
40
|
-
### Các thành phần:
|
|
41
|
-
|
|
42
|
-
#### 1. Media Query (MQ) - Tùy chọn
|
|
43
|
-
|
|
44
|
-
- `xs:` - Màn hình nhỏ (max-width: 575px)
|
|
45
|
-
- `sm:` - Màn hình nhỏ (min-width: 576px)
|
|
46
|
-
- `md:` - Màn hình trung bình (min-width: 768px)
|
|
47
|
-
- `lg:` - Màn hình lớn (min-width: 992px)
|
|
48
|
-
- `xl:` - Màn hình rất lớn (min-width: 1200px)
|
|
49
|
-
- `2xl:` - Màn hình cực lớn (min-width: 1400px)
|
|
50
|
-
- `sma:` - Màn hình nhỏ trở xuống (max-width: 768px)
|
|
51
|
-
- `mda:` - Màn hình trung bình trở xuống (max-width: 992px)
|
|
52
|
-
- `lga:` - Màn hình lớn trở xuống (max-width: 1200px)
|
|
53
|
-
- `xla:` - Màn hình rất lớn trở xuống (max-width: 1400px)
|
|
54
|
-
|
|
55
|
-
#### 2. Layer - Tùy chọn
|
|
56
|
-
|
|
57
|
-
- `1` đến `19` - Thứ tự ưu tiên CSS layer (số càng cao ưu tiên càng cao)
|
|
58
|
-
- Mặc định: `0` (layer 0)
|
|
59
|
-
- Mục đích: gom nhóm quy tắc theo tầng (base, component, utilities, overrides…)
|
|
60
|
-
|
|
61
|
-
#### 3. Property (Thuộc tính) - **BẮT BUỘC**
|
|
62
|
-
|
|
63
|
-
- Viết thường, có thể là tên đầy đủ hoặc viết tắt
|
|
64
|
-
- Không có dấu `-` trừ trường hợp có thuộc tính có dấu trừ thường bắt đầu `-w`
|
|
65
|
-
- Ví dụ: `w` (width), `h` (height), `c` (color), `bg` (background)
|
|
66
|
-
|
|
67
|
-
#### 4. Value (Giá trị) - **BẮT BUỘC**
|
|
68
|
-
|
|
69
|
-
- **Số**: `10`, `-4.5`, `0.5`, có thể kèm **đơn vị**: `10px`, `1.5rem`, `100%`
|
|
70
|
-
- **Giá trị đặt tên** bắt đầu bằng **chữ hoa**: `Red`, `Center`, `Block`, `Fixed`, `None`
|
|
71
|
-
- **Giá trị trong ngoặc nhọn** để ghi **nguyên văn**: `c{rgb(255,0,0)}`, `bg{linear-gradient(...)}`
|
|
72
|
-
- **Biến CSS**: bắt đầu bằng `--`: `c--primary` → `color: var(--primary)`
|
|
73
|
-
- **Quan trọng**: thêm `!` ngay trước giá trị để ra `!important`: `w!10px` → `width: 10px !important`
|
|
74
|
-
- **Hàm**: dùng dạng **TitleCase** + `(...)` và dùng dấu `;` thay cho khoảng trắng:
|
|
75
|
-
- `wCalc(100%;-;20px)` → `width: calc(100% - 20px)`
|
|
76
|
-
- `tTranslate(50%;,;-50%)` → `transform: translate(50% , -50%)`
|
|
77
|
-
|
|
78
|
-
#### 5. Selector - Tùy chọn
|
|
79
|
-
|
|
80
|
-
- Bắt đầu bằng `@`
|
|
81
|
-
- Dấu `;` thay thế cho dấu cách
|
|
82
|
-
- Có thể dùng giả lớp/giả phần tử, chọn phần tử con, hoặc kết hợp
|
|
83
|
-
- Ví dụ: `@:hover`, `@:focus`, `@:active`, `@>a`, `@.btn;:hover`
|
|
84
|
-
|
|
85
|
-
## Ví dụ sử dụng
|
|
86
|
-
|
|
87
|
-
### Cơ bản
|
|
88
|
-
|
|
89
|
-
```html
|
|
90
|
-
<!-- Màu đỏ -->
|
|
91
|
-
<div class="cRed">Văn bản màu đỏ</div>
|
|
92
|
-
|
|
93
|
-
<!-- Chiều rộng 100px -->
|
|
94
|
-
<div class="w100px">Chiều rộng 100px</div>
|
|
95
|
-
|
|
96
|
-
<!-- Padding 20px -->
|
|
97
|
-
<div class="p20px">Padding 20px</div>
|
|
98
|
-
|
|
99
|
-
<!-- Opacity 50% -->
|
|
100
|
-
<div class="opc50%">Độ trong suốt 50%</div>
|
|
101
|
-
|
|
102
|
-
<!-- Font size 14px -->
|
|
103
|
-
<div class="fns14px">Cỡ chữ 14px</div>
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Với Media Query
|
|
107
|
-
|
|
108
|
-
```html
|
|
109
|
-
<!-- Màu đỏ trên màn hình lớn -->
|
|
110
|
-
<div class="lg:cRed">Màu đỏ trên desktop</div>
|
|
111
|
-
|
|
112
|
-
<!-- Ẩn trên màn hình nhỏ -->
|
|
113
|
-
<div class="xs:vHidden">Ẩn trên mobile</div>
|
|
114
|
-
|
|
115
|
-
<!-- Responsive width -->
|
|
116
|
-
<div class="w100% md:w50% lg:w33%">Responsive width</div>
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### Với Layer
|
|
120
|
-
|
|
121
|
-
```html
|
|
122
|
-
<!-- Layer ưu tiên cao -->
|
|
123
|
-
<div class="5cRed">Màu đỏ ưu tiên cao</div>
|
|
124
|
-
|
|
125
|
-
<!-- Layer ưu tiên thấp -->
|
|
126
|
-
<div class="1cBlue">Màu xanh ưu tiên thấp</div>
|
|
127
|
-
|
|
128
|
-
<!-- Kết hợp layer và media query -->
|
|
129
|
-
<div class="md:7cGreen">Màu xanh layer 7 trên desktop</div>
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### Với Selector
|
|
133
|
-
|
|
134
|
-
```html
|
|
135
|
-
<!-- Hover effect -->
|
|
136
|
-
<div class="cRed@:hover">Đỏ khi hover</div>
|
|
137
|
-
|
|
138
|
-
<!-- Focus effect -->
|
|
139
|
-
<input class="bdw2px@:focus" placeholder="Border khi focus" />
|
|
140
|
-
|
|
141
|
-
<!-- Child selector -->
|
|
142
|
-
<div class="cBlue@>a">Màu xanh cho thẻ con a</div>
|
|
143
|
-
|
|
144
|
-
<!-- Complex selector -->
|
|
145
|
-
<div class="cRed@.btn;:hover">Màu đỏ khi hover button</div>
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### Với giá trị đặc biệt
|
|
149
|
-
|
|
150
|
-
```html
|
|
151
|
-
<!-- !important -->
|
|
152
|
-
<div class="c!red">Màu đỏ !important</div>
|
|
153
|
-
|
|
154
|
-
<!-- CSS Variable -->
|
|
155
|
-
<div class="c--primary">Màu từ CSS variable</div>
|
|
156
|
-
|
|
157
|
-
<!-- Giá trị tùy chỉnh -->
|
|
158
|
-
<div class="w{calc(100%;-;20px)}">Chiều rộng tính toán</div>
|
|
159
|
-
|
|
160
|
-
<!-- Hàm CSS -->
|
|
161
|
-
<div class="wClamp(280px;640px;100%)">Width với clamp</div>
|
|
162
|
-
|
|
163
|
-
<!-- Box shadow phức tạp -->
|
|
164
|
-
<div class="bxsh{0;2px;8px;rgba(0,0,0,.1)}">Shadow phức tạp</div>
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
### Kết hợp nhiều thuộc tính với `&`
|
|
168
|
-
|
|
169
|
-
```html
|
|
170
|
-
<!-- Nhiều thuộc tính cùng lúc -->
|
|
171
|
-
<div class="cRed&fw700&taC">Màu đỏ, font-weight 700, căn giữa</div>
|
|
172
|
-
|
|
173
|
-
<!-- Flexbox layout -->
|
|
174
|
-
<div class="dF&aiC&jcSp">Flexbox center và space-between</div>
|
|
175
|
-
|
|
176
|
-
<!-- Padding và margin -->
|
|
177
|
-
<div class="p8px&m0">Padding 8px và margin 0</div>
|
|
178
|
-
|
|
179
|
-
<!-- Kết hợp với selector -->
|
|
180
|
-
<div class="cRed&fw700@:hover">Màu đỏ và font-weight 700 khi hover</div>
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
## Quy tắc ưu tiên & va chạm
|
|
184
|
-
|
|
185
|
-
1. **@layer**: lớp số lớn thắng lớp số nhỏ (khi cùng nguồn gốc/specificity)
|
|
186
|
-
2. **Specificity** của selector: selector cụ thể hơn thắng
|
|
187
|
-
3. **Thứ tự xuất hiện** trong cùng layer và cùng specificity
|
|
188
|
-
4. **!important** luôn thắng các quy tắc thường trong cùng phạm vi cascade
|
|
189
|
-
|
|
190
|
-
Ví dụ: `5cBlue` vs `9cRed` → `9cRed` thắng. Nhưng `5cBlue!` (viết `c!Blue` hoặc `c!{blue}`) có thể tiếp tục thắng nếu cùng layer/scope.
|
|
191
|
-
|
|
192
|
-
## Quy tắc quan trọng
|
|
193
|
-
|
|
194
|
-
### ✅ Hợp lệ
|
|
195
|
-
|
|
196
|
-
- `cRed` - Màu đỏ (property: `c`, value: `Red`)
|
|
197
|
-
- `w10px` - Chiều rộng 10px (property: `w`, value: `10px`)
|
|
198
|
-
- `md:cRed` - Màu đỏ trên màn hình trung bình (MQ: `md`, property: `c`, value: `Red`)
|
|
199
|
-
- `2w100px` - Chiều rộng 100px ở layer 2 (layer: `2`, property: `w`, value: `100px`)
|
|
200
|
-
- `cRed@:hover` - Màu đỏ khi hover (property: `c`, value: `Red`, selector: `@:hover`)
|
|
201
|
-
- `w!100px` - Chiều rộng 100px !important (property: `w`, value: `!100px`)
|
|
202
|
-
- `c{red}` - Màu đỏ với giá trị tùy chỉnh (property: `c`, value: `{red}`)
|
|
203
|
-
- `cRed&w700` - Kết hợp nhiều thuộc tính (property: `c`, value: `Red`, property: `w`, value: `700`)
|
|
204
|
-
- `wCalc(100%;-;20px)` - Hàm CSS với dấu `;` (property: `w`, value: `Calc(100%;-;20px)`)
|
|
205
|
-
|
|
206
|
-
### ❌ Không hợp lệ
|
|
207
|
-
|
|
208
|
-
- `Cred` - Chữ C viết hoa ở thuộc tính (property phải viết thường)
|
|
209
|
-
- `C{red}` - Chữ C viết hoa ở thuộc tính (property phải viết thường)
|
|
210
|
-
- `cRed}` - Thiếu dấu mở ngoặc (syntax lỗi)
|
|
211
|
-
- `c-red` - Dấu gạch ngang không được phép (property không được có dấu `-`)
|
|
212
|
-
- `W-10px` - Chữ W viết hoa và dấu gạch ngang (property phải viết thường)
|
|
213
|
-
- `w-!10px` - Dấu gạch ngang không được phép (property không được có dấu `-`)
|
|
214
|
-
- `cRed @:hover` - Có dấu cách trong class name (không được có dấu cách)
|
|
215
|
-
- `c` - Thiếu value (bắt buộc phải có cả property và value)
|
|
216
|
-
- `Red` - Thiếu property (bắt buộc phải có cả property và value)
|
|
217
|
-
|
|
218
|
-
## Lỗi phổ biến & cách tránh
|
|
219
|
-
|
|
220
|
-
- **Dùng chữ hoa ở đầu thuộc tính** → sai. Thuộc tính (**property**) phải là **chữ thường** hoặc `--var`
|
|
221
|
-
- **Thiếu property hoặc value** → sai. Cả hai đều **bắt buộc** phải có
|
|
222
|
-
- **Nhầm dấu `-` và `!`**: `w-!10px` là lỗi. Hãy dùng `w!10px`
|
|
223
|
-
- **Quên `;` trong giá trị có khoảng trắng**: `ff{Courier New}` → nên viết `ff{Courier;New}`
|
|
224
|
-
- **Selector có khoảng trắng** phải dùng `;` và sẽ được đổi lại khi xuất
|
|
225
|
-
- **Không có bảng viết tắt** → trình biên dịch không biết dịch `ta` thành `text-align`
|
|
226
|
-
|
|
227
|
-
## Lưu ý
|
|
228
|
-
|
|
229
|
-
1. **Property và Value bắt buộc** - Mỗi class phải có cả thuộc tính và giá trị CSS
|
|
230
|
-
2. **Tên class phải viết thường** - Chỉ property viết thường, value có thể có ký tự HOA
|
|
231
|
-
3. **Không dùng dấu cách** - Dùng dấu `;` thay thế
|
|
232
|
-
4. **CSS.supports validation** - Tất cả class phải được CSS hỗ trợ
|
|
233
|
-
5. **Thứ tự ưu tiên** - Layer số cao hơn sẽ có ưu tiên cao hơn
|
|
234
|
-
6. **Media Query** - Chỉ áp dụng trong khoảng màn hình tương ứng
|
|
235
|
-
7. **Khoảng trắng trong giá trị** dùng dấu `;`. Ví dụ: `ff{Courier;New;monospace}` → `font-family: Courier New, monospace`
|
|
236
|
-
|
|
237
|
-
## Lời khuyên từ kinh nghiệm thực tế
|
|
238
|
-
|
|
239
|
-
### 🎯 **Nguyên tắc đặt tên class**
|
|
240
|
-
|
|
241
|
-
#### ✅ **Nên làm:**
|
|
242
|
-
|
|
243
|
-
- **Ngắn gọn, dễ đọc**: `cRed`, `w100px`, `p16px`
|
|
244
|
-
- **Sử dụng viết tắt chuẩn**: `dF` thay vì `displayFlex` (d: display, F: Flex)
|
|
245
|
-
|
|
246
|
-
#### ❌ **Tránh:**
|
|
247
|
-
|
|
248
|
-
- **Tên quá dài**: `wCalc(100%;-;20px;-;30px;-;10px)` → nên dùng CSS variable
|
|
249
|
-
- **Giá trị phức tạp**: `bxsh{0;4px;8px;12px;rgba(0,0,0,0.1);inset}` → nên định nghĩa qua biến
|
|
250
|
-
- **Thuộc tính lặp lại**: `cRed`, `cBlue`, `cGreen` → nên dùng color palette
|
|
251
|
-
|
|
252
|
-
### 🎨 **Quản lý giá trị phức tạp**
|
|
253
|
-
|
|
254
|
-
#### **Sử dụng CSS Variables cho giá trị dài:**
|
|
255
|
-
|
|
256
|
-
```css
|
|
257
|
-
:root {
|
|
258
|
-
--shadow-card: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
259
|
-
--shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.15);
|
|
260
|
-
--border-radius: 8px;
|
|
261
|
-
--spacing-sm: 8px;
|
|
262
|
-
--spacing-md: 16px;
|
|
263
|
-
--spacing-lg: 24px;
|
|
264
|
-
}
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
```html
|
|
268
|
-
<!-- Thay vì viết dài -->
|
|
269
|
-
<div class="bxsh{0;4px;8px;rgba(0,0,0,0.1)} bdra8px p16px">
|
|
270
|
-
<!-- Nên dùng biến -->
|
|
271
|
-
<div class="bxsh--shadow-card bdra--border-radius p--spacing-md"></div>
|
|
272
|
-
</div>
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
#### **Tạo component classes cho pattern thường dùng:**
|
|
276
|
-
|
|
277
|
-
```html
|
|
278
|
-
<!-- Thay vì lặp lại nhiều lần -->
|
|
279
|
-
<div class="dF&aiC&jcSp&p16px&bgcWhite&bxsh{0;2px;4px;rgba(0,0,0,0.1)}">
|
|
280
|
-
<!-- Nên tạo component class -->
|
|
281
|
-
<div class="card"></div>
|
|
282
|
-
</div>
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
### 📱 **Responsive Design Best Practices**
|
|
286
|
-
|
|
287
|
-
#### **Sử dụng mobile-first approach:**
|
|
288
|
-
|
|
289
|
-
```html
|
|
290
|
-
<!-- Base styles cho mobile -->
|
|
291
|
-
<div class="w100% p8px">
|
|
292
|
-
<!-- Override cho desktop -->
|
|
293
|
-
<div class="md:w50% md:p16px lg:w33% lg:p24px"></div>
|
|
294
|
-
</div>
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
#### **Nhóm breakpoints logic:**
|
|
298
|
-
|
|
299
|
-
```html
|
|
300
|
-
<!-- Layout chính -->
|
|
301
|
-
<div class="dB md:dF">
|
|
302
|
-
<!-- Spacing responsive -->
|
|
303
|
-
<div class="p8px md:p16px lg:p24px">
|
|
304
|
-
<!-- Typography responsive -->
|
|
305
|
-
<div class="fns14px md:fns16px lg:fns18px"></div>
|
|
306
|
-
</div>
|
|
307
|
-
</div>
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
### 🎭 **Layer Management**
|
|
311
|
-
|
|
312
|
-
#### **Tổ chức layers theo hierarchy:**
|
|
313
|
-
|
|
314
|
-
```html
|
|
315
|
-
<!-- Base styles (0) -->
|
|
316
|
-
<div class="cBlack fns16px">
|
|
317
|
-
<!-- Component styles (1-5) -->
|
|
318
|
-
<div class="2btnPrimary">
|
|
319
|
-
<!-- Utility styles (6-10) -->
|
|
320
|
-
<div class="8m16px">
|
|
321
|
-
<!-- Override styles (11-19) -->
|
|
322
|
-
<div class="15cRed"></div>
|
|
323
|
-
</div>
|
|
324
|
-
</div>
|
|
325
|
-
</div>
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
### 🔧 **Performance Tips**
|
|
329
|
-
|
|
330
|
-
#### **Tránh over-engineering:**
|
|
331
|
-
|
|
332
|
-
```html
|
|
333
|
-
<!-- Đơn giản và hiệu quả -->
|
|
334
|
-
<div class="dF&aiC&p16px">
|
|
335
|
-
<!-- Thay vì phức tạp không cần thiết -->
|
|
336
|
-
<div class="dF&aiC&jcC&p16px&m0&b0&bgcT"></div>
|
|
337
|
-
</div>
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
#### **Sử dụng shorthand khi có thể:**
|
|
341
|
-
|
|
342
|
-
```html
|
|
343
|
-
<!-- Margin shorthand -->
|
|
344
|
-
<div class="m16px">
|
|
345
|
-
<!-- margin: 16px -->
|
|
346
|
-
<div class="mt8px&mb8px">
|
|
347
|
-
<!-- margin-top: 8px; margin-bottom: 8px -->
|
|
348
|
-
|
|
349
|
-
<!-- Padding shorthand -->
|
|
350
|
-
<div class="p16px">
|
|
351
|
-
<!-- padding: 16px -->
|
|
352
|
-
<div class="px16px&py8px"><!-- padding: 8px 16px --></div>
|
|
353
|
-
</div>
|
|
354
|
-
</div>
|
|
355
|
-
</div>
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
### 🎨 **Design System Integration**
|
|
359
|
-
|
|
360
|
-
#### **Tạo design tokens:**
|
|
361
|
-
|
|
362
|
-
```css
|
|
363
|
-
:root {
|
|
364
|
-
/* Colors */
|
|
365
|
-
--color-primary: #0070f3;
|
|
366
|
-
--color-secondary: #7928ca;
|
|
367
|
-
--color-success: #0070f3;
|
|
368
|
-
--color-warning: #f5a623;
|
|
369
|
-
--color-error: #e00;
|
|
370
|
-
|
|
371
|
-
/* Spacing scale */
|
|
372
|
-
--space-1: 4px;
|
|
373
|
-
--space-2: 8px;
|
|
374
|
-
--space-3: 12px;
|
|
375
|
-
--space-4: 16px;
|
|
376
|
-
--space-5: 20px;
|
|
377
|
-
--space-6: 24px;
|
|
378
|
-
|
|
379
|
-
/* Typography scale */
|
|
380
|
-
--text-xs: 12px;
|
|
381
|
-
--text-sm: 14px;
|
|
382
|
-
--text-base: 16px;
|
|
383
|
-
--text-lg: 18px;
|
|
384
|
-
--text-xl: 20px;
|
|
385
|
-
}
|
|
386
|
-
```
|
|
387
|
-
|
|
388
|
-
#### **Sử dụng semantic naming:**
|
|
389
|
-
|
|
390
|
-
```html
|
|
391
|
-
<!-- Thay vì màu cụ thể -->
|
|
392
|
-
<div class="cBlue">
|
|
393
|
-
<!-- Nên dùng semantic -->
|
|
394
|
-
<div class="cPrimary">
|
|
395
|
-
<div class="cSuccess">
|
|
396
|
-
<div class="cError"></div>
|
|
397
|
-
</div>
|
|
398
|
-
</div>
|
|
399
|
-
</div>
|
|
400
|
-
```
|
|
401
|
-
|
|
402
|
-
### 🚀 **Maintenance Tips**
|
|
403
|
-
|
|
404
|
-
#### **Documentation cho team:**
|
|
405
|
-
|
|
406
|
-
```html
|
|
407
|
-
<!-- Component: Button Primary -->
|
|
408
|
-
<!-- Usage: <button class="btnPrimary">Click me</button> -->
|
|
409
|
-
<!-- Variants: btnSecondary, btnDanger, btnGhost -->
|
|
410
|
-
<button class="btnPrimary">Click me</button>
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
#### **Consistent naming convention:**
|
|
414
|
-
|
|
415
|
-
```html
|
|
416
|
-
<!-- Layout -->
|
|
417
|
-
<div class="container">
|
|
418
|
-
<div class="row">
|
|
419
|
-
<div class="col">
|
|
420
|
-
<!-- Components -->
|
|
421
|
-
<div class="card">
|
|
422
|
-
<div class="btn">
|
|
423
|
-
<div class="input">
|
|
424
|
-
<!-- Utilities -->
|
|
425
|
-
<div class="textCenter">
|
|
426
|
-
<div class="mAuto">
|
|
427
|
-
<div class="dNone"></div>
|
|
428
|
-
</div>
|
|
429
|
-
</div>
|
|
430
|
-
</div>
|
|
431
|
-
</div>
|
|
432
|
-
</div>
|
|
433
|
-
</div>
|
|
434
|
-
</div>
|
|
435
|
-
</div>
|
|
436
|
-
```
|
|
437
|
-
|
|
438
|
-
### 💡 **Pro Tips**
|
|
439
|
-
|
|
440
|
-
1. **Luôn test trên mobile trước** - Mobile-first approach
|
|
441
|
-
2. **Sử dụng browser dev tools** - Kiểm tra CSS output
|
|
442
|
-
3. **Tạo style guide** - Document các pattern thường dùng
|
|
443
|
-
4. **Code review** - Đảm bảo consistency trong team
|
|
444
|
-
5. **Performance monitoring** - Theo dõi CSS bundle size
|
|
445
|
-
6. **Accessibility first** - Luôn nghĩ đến người dùng khuyết tật
|
|
446
|
-
|
|
447
|
-
## Ví dụ tổng hợp
|
|
448
|
-
|
|
449
|
-
**HTML**
|
|
450
|
-
|
|
451
|
-
```html
|
|
452
|
-
<div
|
|
453
|
-
class="md:7 dF&aiC&jcSp p16px bgc--panel bxsh{0;2px;8px;rgba(0,0,0,.1)} c--fg@>a;:hover"
|
|
454
|
-
>
|
|
455
|
-
<a class="cBlue wClamp(120px;240px;100%)">Link</a>
|
|
456
|
-
<button class="w!120px h40px bdra8px cWhite bgc#0070f3">Nút</button>
|
|
457
|
-
</div>
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
**CSS (phát sinh ý tưởng)**
|
|
461
|
-
|
|
462
|
-
```css
|
|
463
|
-
@media (min-width: 768px) {
|
|
464
|
-
@layer l7 {
|
|
465
|
-
.md\:7\.dF\&aiC\&jcSp\:where(*) {
|
|
466
|
-
display: flex;
|
|
467
|
-
align-items: center;
|
|
468
|
-
justify-content: space-between;
|
|
469
|
-
padding: 16px;
|
|
470
|
-
background-color: var(--panel);
|
|
471
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
472
|
-
}
|
|
473
|
-
.md\:7\.c\-\-fg\@\>a\;\:hover > a:hover {
|
|
474
|
-
color: var(--fg);
|
|
475
|
-
}
|
|
476
|
-
.md\:7\.wClamp\(120px\;240px\;100\%\) {
|
|
477
|
-
width: clamp(120px, 240px, 100%);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
.cBlue {
|
|
482
|
-
color: blue;
|
|
483
|
-
}
|
|
484
|
-
.w\!120px {
|
|
485
|
-
width: 120px !important;
|
|
486
|
-
}
|
|
487
|
-
.h40px {
|
|
488
|
-
height: 40px;
|
|
489
|
-
}
|
|
490
|
-
.bdra8px {
|
|
491
|
-
border-radius: 8px;
|
|
492
|
-
}
|
|
493
|
-
.cWhite {
|
|
494
|
-
color: #fff;
|
|
495
|
-
}
|
|
496
|
-
.bgc\#0070f3 {
|
|
497
|
-
background-color: #0070f3;
|
|
498
|
-
}
|
|
499
|
-
```
|
|
500
|
-
|
|
501
|
-
## Bảng tra cứu nhanh
|
|
502
|
-
|
|
503
|
-
### Media Query
|
|
504
|
-
|
|
505
|
-
| Ký hiệu | Kích thước màn hình |
|
|
506
|
-
| ------- | ------------------- |
|
|
507
|
-
| `xs:` | ≤ 575px |
|
|
508
|
-
| `sm:` | ≥ 576px |
|
|
509
|
-
| `md:` | ≥ 768px |
|
|
510
|
-
| `lg:` | ≥ 992px |
|
|
511
|
-
| `xl:` | ≥ 1200px |
|
|
512
|
-
| `2xl:` | ≥ 1400px |
|
|
513
|
-
|
|
514
|
-
### Layer
|
|
515
|
-
|
|
516
|
-
| Ký hiệu | Mô tả |
|
|
517
|
-
| ------- | ---------------------------------------------- |
|
|
518
|
-
| `0` | Layer mặc định (ưu tiên thấp) |
|
|
519
|
-
| `1-19` | Layer tùy chỉnh (số càng cao ưu tiên càng cao) |
|
|
520
|
-
|
|
521
|
-
### Giá trị đặc biệt
|
|
522
|
-
|
|
523
|
-
| Ký hiệu | Ý nghĩa |
|
|
524
|
-
| ------- | ----------------- |
|
|
525
|
-
| `!` | !important |
|
|
526
|
-
| `--` | CSS Variable |
|
|
527
|
-
| `{}` | Giá trị tùy chỉnh |
|
|
528
|
-
| `;` | Thay thế dấu cách |
|
|
529
|
-
|
|
530
|
-
## Câu hỏi thường gặp (FAQ)
|
|
531
|
-
|
|
532
|
-
**Hỏi:** Tại sao phải viết hoa chữ cái đầu giá trị dạng từ khoá?
|
|
533
|
-
|
|
534
|
-
**Đáp:** Để phân biệt **p** (thuộc tính viết thường) và **v** (giá trị đặt tên). Tránh nhầm `red` (giá trị) với một thuộc tính giả định.
|
|
535
|
-
|
|
536
|
-
**Hỏi:** Dùng dấu gì cho khoảng trắng?
|
|
537
|
-
|
|
538
|
-
**Đáp:** Dùng dấu `;` trong **giá trị** và **selector** để không phá vỡ tên class.
|
|
539
|
-
|
|
540
|
-
**Hỏi:** Tôi muốn thêm breakpoint mới?
|
|
541
|
-
|
|
542
|
-
**Đáp:** Bổ sung mã tiền tố (ví dụ `xxl:`) và map sang `@media (min-width: …)` trong cấu hình biên dịch.
|
|
543
|
-
|
|
544
|
-
**Hỏi:** Có cần escape khi viết trong HTML?
|
|
545
|
-
|
|
546
|
-
**Đáp:** Không. Bạn viết thô như quy ước. Bộ biên dịch sẽ escape khi phát sinh CSS.
|
|
547
|
-
|
|
548
|
-
---
|
|
549
|
-
|
|
550
|
-
# Bảng tra cứu đầy đủ thuộc tính và giá trị xCSS
|
|
551
|
-
|
|
552
|
-
## Cấu trúc dữ liệu
|
|
553
|
-
|
|
554
|
-
- **Viết tắt**: Ký hiệu ngắn gọn để sử dụng trong class
|
|
555
|
-
- **Thuộc tính CSS**: Tên đầy đủ của thuộc tính CSS
|
|
556
|
-
- **Giá trị viết tắt**: Mapping từ ký hiệu sang giá trị CSS (nếu có)
|
|
557
|
-
|
|
558
|
-
---
|
|
559
|
-
|
|
560
|
-
## 1. Layout & Display
|
|
561
|
-
|
|
562
|
-
### Display
|
|
563
|
-
|
|
564
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
565
|
-
| -------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
566
|
-
| `d` | `display` | `b:block`, `ib:inline-block`, `i:inline`, `f:flex`, `if:inline-flex`, `t:table`, `it:inline-table`, `tcp:table-caption`, `tcell:table-cell`, `tcol:table-column`, `tcolg:table-column-group`, `tfg:table-footer-group`, `thg:table-header-group`, `trg:table-row-group`, `tr:table-row`, `fr:flow-root`, `g:grid`, `ig:inline-grid`, `c:contents`, `li:list-item` |
|
|
567
|
-
|
|
568
|
-
### Position
|
|
569
|
-
|
|
570
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
571
|
-
| -------- | ---------- | -------------------------------------------------------------- |
|
|
572
|
-
| `pos` | `position` | `s:static`, `f:fixed`, `a:absolute`, `r:relative`, `st:sticky` |
|
|
573
|
-
|
|
574
|
-
### Sizing
|
|
575
|
-
|
|
576
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
577
|
-
| -------- | ----------------- | ---------------------------------------------------------------- |
|
|
578
|
-
| `w` | `width` | `mic:min-content`, `mac:max-content`, `fc:fit-content`, `f:100%` |
|
|
579
|
-
| `h` | `height` | `mic:min-content`, `mac:max-content`, `fc:fit-content` |
|
|
580
|
-
| `mw` | `max-width` | - |
|
|
581
|
-
| `mxw` | `max-width` | - |
|
|
582
|
-
| `mh` | `max-height` | - |
|
|
583
|
-
| `miw` | `min-width` | `f:100%`, `mic:min-content`, `mac:max-content`, `fc:fit-content` |
|
|
584
|
-
| `mih` | `min-height` | `f:100%`, `mic:min-content`, `mac:max-content`, `fc:fit-content` |
|
|
585
|
-
| `blks` | `block-size` | - |
|
|
586
|
-
| `ins` | `inline-size` | - |
|
|
587
|
-
| `mbs` | `max-block-size` | - |
|
|
588
|
-
| `mis` | `max-inline-size` | - |
|
|
589
|
-
| `mibs` | `min-block-size` | - |
|
|
590
|
-
| `misz` | `min-inline-size` | - |
|
|
591
|
-
|
|
592
|
-
### Positioning
|
|
593
|
-
|
|
594
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
595
|
-
| -------- | -------------------- | ---------------- |
|
|
596
|
-
| `t` | `top` | - |
|
|
597
|
-
| `r` | `right` | - |
|
|
598
|
-
| `b` | `bottom` | - |
|
|
599
|
-
| `l` | `left` | - |
|
|
600
|
-
| `i` | `inset` | - |
|
|
601
|
-
| `iblk` | `inset-block` | - |
|
|
602
|
-
| `ibe` | `inset-block-end` | - |
|
|
603
|
-
| `ibsta` | `inset-block-start` | - |
|
|
604
|
-
| `ii` | `inset-inline` | - |
|
|
605
|
-
| `iie` | `inset-inline-end` | - |
|
|
606
|
-
| `iis` | `inset-inline-start` | - |
|
|
607
|
-
|
|
608
|
-
---
|
|
609
|
-
|
|
610
|
-
## 2. Spacing
|
|
611
|
-
|
|
612
|
-
### Margin
|
|
613
|
-
|
|
614
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
615
|
-
| -------- | --------------------- | ---------------- |
|
|
616
|
-
| `m` | `margin` | - |
|
|
617
|
-
| `mt` | `margin-top` | - |
|
|
618
|
-
| `mr` | `margin-right` | - |
|
|
619
|
-
| `mb` | `margin-bottom` | - |
|
|
620
|
-
| `ml` | `margin-left` | - |
|
|
621
|
-
| `mblk` | `margin-block` | - |
|
|
622
|
-
| `mbe` | `margin-block-end` | - |
|
|
623
|
-
| `mbsta` | `margin-block-start` | - |
|
|
624
|
-
| `min` | `margin-inline` | - |
|
|
625
|
-
| `mie` | `margin-inline-end` | - |
|
|
626
|
-
| `mista` | `margin-inline-start` | - |
|
|
627
|
-
|
|
628
|
-
### Padding
|
|
629
|
-
|
|
630
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
631
|
-
| -------- | ---------------------- | ---------------------------------------------------------- |
|
|
632
|
-
| `p` | `padding` | - |
|
|
633
|
-
| `pt` | `padding-top` | - |
|
|
634
|
-
| `pr` | `padding-right` | - |
|
|
635
|
-
| `pb` | `padding-bottom` | - |
|
|
636
|
-
| `pl` | `padding-left` | - |
|
|
637
|
-
| `pblk` | `padding-block` | - |
|
|
638
|
-
| `pbe` | `padding-block-end` | - |
|
|
639
|
-
| `pbs` | `padding-block-start` | - |
|
|
640
|
-
| `pi` | `padding-inline` | `s:start`, `c:center`, `e:end`, `b:baseline`, `st:stretch` |
|
|
641
|
-
| `pie` | `padding-inline-end` | - |
|
|
642
|
-
| `pis` | `padding-inline-start` | - |
|
|
643
|
-
|
|
644
|
-
---
|
|
645
|
-
|
|
646
|
-
## 3. Colors & Background
|
|
647
|
-
|
|
648
|
-
### Color
|
|
649
|
-
|
|
650
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
651
|
-
| -------- | ---------- | ---------------------------- |
|
|
652
|
-
| `c` | `color` | `i:inherit`, `t:transparent` |
|
|
653
|
-
|
|
654
|
-
### Background
|
|
655
|
-
|
|
656
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
657
|
-
| -------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
658
|
-
| `bg` | `background` | - |
|
|
659
|
-
| `bgc` | `background-color` | `t:transparent`, `c:currentcolor` |
|
|
660
|
-
| `bgi` | `background-image` | - |
|
|
661
|
-
| `bgp` | `background-position` | `t:top`, `b:bottom`, `l:left`, `r:right`, `c:center`, `lt:left top`, `ct:center top`, `rt:right top`, `lc:left center`, `cc:center center`, `rc:right center`, `lb:left bottom`, `cb:center bottom`, `rb:right bottom` |
|
|
662
|
-
| `bgpx` | `background-position-x` | `l:left`, `r:right`, `c:center` |
|
|
663
|
-
| `bgpy` | `background-position-y` | `t:top`, `b:bottom`, `c:center` |
|
|
664
|
-
| `bgr` | `background-repeat` | `r:repeat`, `x:repeat-x`, `y:repeat-y`, `s:space`, `rn:round`, `n:no-repeat`, `rs: repeat space`, `rr:repeat repeat`, `nr:no-repeat round` |
|
|
665
|
-
| `bgs` | `background-size` | `c:contain` |
|
|
666
|
-
| `bga` | `background-attachment` | `s:scroll`, `f:fixed`, `l:local` |
|
|
667
|
-
| `bgbm` | `background-blend-mode` | `n:normal`, `m:multiply`, `s:screen`, `o:overlay`, `d:darken`, `l:lighten`, `cd:color-dodge`, `i:color-burn`, `hl:hard-light`, `sl:soft-light`, `di:difference`, `e:exclusion`, `h:hue`, `sa:saturation`, `c:color`, `lu:luminosity` |
|
|
668
|
-
| `bgcl` | `background-clip` | `bb:border-box`, `pb:padding-box`, `cb:content-box`, `t:text` |
|
|
669
|
-
| `bgo` | `background-origin` | `bb:border-box`, `pb:padding-box`, `cb:content-box` |
|
|
670
|
-
|
|
671
|
-
---
|
|
672
|
-
|
|
673
|
-
## 4. Border
|
|
674
|
-
|
|
675
|
-
### Border General
|
|
676
|
-
|
|
677
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
678
|
-
| -------- | -------------- | ------------------------------------------------------------------------------------------------- |
|
|
679
|
-
| `bd` | `border` | `d:dotted`, `ds:dashed`, `db:double`, `g:groove`, `r:ridge`, `i:inset`, `o:outset` |
|
|
680
|
-
| `bds` | `border-style` | `dt:dotted`, `ds:dashed`, `s:solid`, `db:double`, `g:groove`, `r:ridge`, `in:inset`, `out:outset` |
|
|
681
|
-
| `bdc` | `border-color` | - |
|
|
682
|
-
| `bdw` | `border-width` | `t:thin`, `m:medium`, `th:thick` |
|
|
683
|
-
|
|
684
|
-
### Border Sides
|
|
685
|
-
|
|
686
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
687
|
-
| -------- | --------------- | ---------------- |
|
|
688
|
-
| `bdt` | `border-top` | - |
|
|
689
|
-
| `bdr` | `border-right` | - |
|
|
690
|
-
| `bdb` | `border-bottom` | - |
|
|
691
|
-
| `bdl` | `border-left` | - |
|
|
692
|
-
|
|
693
|
-
### Border Radius
|
|
694
|
-
|
|
695
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
696
|
-
| -------- | ---------------------------- | ---------------- |
|
|
697
|
-
| `bda` | `border-radius` | - |
|
|
698
|
-
| `bdra` | `border-radius` | - |
|
|
699
|
-
| `bdtlr` | `border-top-left-radius` | - |
|
|
700
|
-
| `bdtrr` | `border-top-right-radius` | - |
|
|
701
|
-
| `bdblr` | `border-bottom-left-radius` | - |
|
|
702
|
-
| `bdbrr` | `border-bottom-right-radius` | - |
|
|
703
|
-
| `bdeer` | `border-end-end-radius` | - |
|
|
704
|
-
| `bdesr` | `border-end-start-radius` | - |
|
|
705
|
-
| `bdser` | `border-start-end-radius` | - |
|
|
706
|
-
| `bdssr` | `border-start-start-radius` | - |
|
|
707
|
-
|
|
708
|
-
### Border Block/Inline
|
|
709
|
-
|
|
710
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
711
|
-
| -------- | --------------------- | ---------------------------------------------------------------------------------- |
|
|
712
|
-
| `bdblk` | `border-block` | - |
|
|
713
|
-
| `bdblc` | `border-block-color` | - |
|
|
714
|
-
| `bdble` | `border-block-end` | - |
|
|
715
|
-
| `bdbls` | `border-block-start` | - |
|
|
716
|
-
| `bdblst` | `border-block-style` | `d:dotted`, `ds:dashed`, `db:double`, `g:groove`, `r:ridge`, `i:inset`, `o:outset` |
|
|
717
|
-
| `bdblwi` | `border-block-width` | - |
|
|
718
|
-
| `bdi` | `border-inline` | - |
|
|
719
|
-
| `bdic` | `border-inline-color` | - |
|
|
720
|
-
| `bdie` | `border-inline-end` | - |
|
|
721
|
-
| `bdista` | `border-inline-start` | - |
|
|
722
|
-
| `bdistl` | `border-inline-style` | - |
|
|
723
|
-
| `bdinw` | `border-inline-width` | - |
|
|
724
|
-
|
|
725
|
-
---
|
|
726
|
-
|
|
727
|
-
## 5. Typography
|
|
728
|
-
|
|
729
|
-
### Font
|
|
730
|
-
|
|
731
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
732
|
-
| -------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
733
|
-
| `fn` | `font` | - |
|
|
734
|
-
| `ff` | `font-family` | `a:ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'`, `s:ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif`, `m:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace` |
|
|
735
|
-
| `fnf` | `font-family` | - |
|
|
736
|
-
| `fns` | `font-size` | - |
|
|
737
|
-
| `fw` | `font-weight` | - |
|
|
738
|
-
| `fnw` | `font-weight` | - |
|
|
739
|
-
| `fnsty` | `font-style` | - |
|
|
740
|
-
| `fnstr` | `font-stretch` | - |
|
|
741
|
-
| `fnfs` | `font-feature-settings` | - |
|
|
742
|
-
| `fnk` | `font-kerning` | - |
|
|
743
|
-
| `fnlo` | `font-language-override` | - |
|
|
744
|
-
| `fnos` | `font-optical-sizing` | - |
|
|
745
|
-
| `fnp` | `font-palette` | - |
|
|
746
|
-
| `fnsa` | `font-size-adjust` | - |
|
|
747
|
-
| `fnsyn` | `font-synthesis` | - |
|
|
748
|
-
| `fnsp` | `font-synthesis-position` | - |
|
|
749
|
-
| `fnssc` | `font-synthesis-small-caps` | - |
|
|
750
|
-
| `fnss` | `font-synthesis-style` | - |
|
|
751
|
-
| `fnsw` | `font-synthesis-weight` | - |
|
|
752
|
-
| `fnv` | `font-variant` | - |
|
|
753
|
-
| `fnva` | `font-variant-alternates` | - |
|
|
754
|
-
| `fnvc` | `font-variant-caps` | - |
|
|
755
|
-
| `fnvea` | `font-variant-east-asian` | - |
|
|
756
|
-
| `fnve` | `font-variant-emoji` | - |
|
|
757
|
-
| `fnvl` | `font-variant-ligatures` | - |
|
|
758
|
-
| `fnvn` | `font-variant-numeric` | - |
|
|
759
|
-
| `fnvp` | `font-variant-position` | - |
|
|
760
|
-
| `fnvs` | `font-variation-settings` | - |
|
|
761
|
-
|
|
762
|
-
### Text
|
|
763
|
-
|
|
764
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
765
|
-
| -------- | --------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
766
|
-
| `ta` | `text-align` | `s:start`, `e:end`, `l:left`, `r:right`, `c:center`, `j:justify`, `mp:match-parent`, `mc:-moz-center`, `wc:-webkit-center` |
|
|
767
|
-
| `tal` | `text-align-last` | `s:start`, `e:end`, `l:left`, `r:right`, `c:center`, `j:justify` |
|
|
768
|
-
| `td` | `text-decoration` | `u:underline` |
|
|
769
|
-
| `tdc` | `text-decoration-color` | - |
|
|
770
|
-
| `tdl` | `text-decoration-line` | `u:underline`, `o:overline`, `lt:line-through`, `b:blink` |
|
|
771
|
-
| `tds` | `text-decoration-style` | `db:double`, `dt:dotted`, `ds:dashed`, `w:wavy` |
|
|
772
|
-
| `tdt` | `text-decoration-thickness` | `ff:from-font` |
|
|
773
|
-
| `tdsi` | `text-decoration-skip-ink` | - |
|
|
774
|
-
| `teph` | `text-emphasis` | - |
|
|
775
|
-
| `tec` | `text-emphasis-color` | - |
|
|
776
|
-
| `tep` | `text-emphasis-position` | `or:over right`, `ol:over left`, `ur:under right`, `ul:under left`, `lo:left over`, `ru:right under`, `lu:left under` |
|
|
777
|
-
| `tes` | `text-emphasis-style` | - |
|
|
778
|
-
| `ti` | `text-indent` | - |
|
|
779
|
-
| `tj` | `text-justify` | `iw:inter-word`, `ic:inter-character`, `d:distribute` |
|
|
780
|
-
| `tor` | `text-orientation` | `m:mixed`, `u:upright`, `sr:sideways-right`, `sl:sideways-left`, `s:sideways`, `ugo:use-glyph-orientation` |
|
|
781
|
-
| `tol` | `text-overflow` | `c:clip`, `e:ellipsis` |
|
|
782
|
-
| `trd` | `text-rendering` | `op:optimizeSpeed`, `ol:optimizeLegibility`, `g:geometricPrecision` |
|
|
783
|
-
| `tsh` | `text-shadow` | - |
|
|
784
|
-
| `ttr` | `text-transform` | `c:capitalize`, `u:uppercase`, `l:lowercase`, `fw:full-width`, `fsk:full-size-kana` |
|
|
785
|
-
| `tuo` | `text-underline-offset` | - |
|
|
786
|
-
| `tup` | `text-underline-position` | `u:under`, `l:left`, `r:right`, `ul:under left`, `ru:right under` |
|
|
787
|
-
| `tw` | `text-wrap` | `w:wrap`, `n:nowrap`, `b:balance`, `p:pretty` |
|
|
788
|
-
|
|
789
|
-
### Line & Spacing
|
|
790
|
-
|
|
791
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
792
|
-
| -------- | ---------------- | ---------------- |
|
|
793
|
-
| `lh` | `line-height` | - |
|
|
794
|
-
| `lts` | `letter-spacing` | `n:normal` |
|
|
795
|
-
| `wrs` | `word-spacing` | - |
|
|
796
|
-
| `lbrk` | `line-break` | - |
|
|
797
|
-
| `wrb` | `word-break` | - |
|
|
798
|
-
| `wrtm` | `writing-mode` | - |
|
|
799
|
-
|
|
800
|
-
---
|
|
801
|
-
|
|
802
|
-
## 6. Flexbox
|
|
803
|
-
|
|
804
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
805
|
-
| -------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
806
|
-
| `fx` | `flex` | `i:0 1 auto`, `a:1 1 auto` |
|
|
807
|
-
| `fxb` | `flex-basis` | - |
|
|
808
|
-
| `fxd` | `flex-direction` | `r:row`, `rr:row-reverse`, `c:column`, `cr:column-reverse` |
|
|
809
|
-
| `fxf` | `flex-flow` | - |
|
|
810
|
-
| `fxg` | `flex-grow` | - |
|
|
811
|
-
| `fxs` | `flex-shrink` | - |
|
|
812
|
-
| `fxw` | `flex-wrap` | `w:wrap`, `wr:wrap-reverse`, `n:nowrap` |
|
|
813
|
-
| `jc` | `justify-content` | `c:center`, `s:start`, `e:end`, `fs:flex-start`, `fe:flex-end`, `l:left`, `r:right`, `n:normal`, `sp:space-between`, `sa:space-around`, `se:space-evenly`, `st:stretch`, `sc:safe center`, `uc:unsafe center` |
|
|
814
|
-
| `ai` | `align-items` | `n:normal`, `c:center`, `s:start`, `e:end`, `fs:flex-start`, `fe:flex-end`, `ss:self-start`, `se:self-end`, `b:baseline`, `fb:first baseline`, `lb:last baseline`, `sc:safe center`, `uc:unsafe center` |
|
|
815
|
-
| `as` | `align-self` | `n:normal`, `c:center`, `s:start`, `e:end`, `ss:self-start`, `se:self-end`, `fs:flex-start`, `fe:flex-end`, `b:baseline`, `fb:first baseline`, `lb:last baseline`, `st:stretch`, `sc:safe center`, `uc:unsafe center` |
|
|
816
|
-
| `ac` | `align-content` | `s:start`, `e:end`, `fs:flex-start`, `fe:flex-end`, `n:normal`, `b:baseline`, `fb:first baseline`, `lb:last baseline`, `sp:space-between`, `sa:space-around`, `se:space-evenly`, `st:stretch`, `sc:safe center`, `uc:unsafe center` |
|
|
817
|
-
|
|
818
|
-
---
|
|
819
|
-
|
|
820
|
-
## 7. Grid
|
|
821
|
-
|
|
822
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
823
|
-
| -------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
824
|
-
| `g` | `grid` | - |
|
|
825
|
-
| `ga` | `grid-area` | - |
|
|
826
|
-
| `gc` | `grid-column` | `f:1 / -1` |
|
|
827
|
-
| `gce` | `grid-column-end` | - |
|
|
828
|
-
| `gcs` | `grid-column-start` | - |
|
|
829
|
-
| `gr` | `grid-row` | `f:1 / -1` |
|
|
830
|
-
| `gre` | `grid-row-end` | - |
|
|
831
|
-
| `grs` | `grid-row-start` | - |
|
|
832
|
-
| `gt` | `grid-template` | - |
|
|
833
|
-
| `gta` | `grid-template-areas` | - |
|
|
834
|
-
| `gtc` | `grid-template-columns` | `s:subgrid` |
|
|
835
|
-
| `gtr` | `grid-template-rows` | `s:subgrid` |
|
|
836
|
-
| `gac` | `grid-auto-columns` | `mic:min-content`, `mac:max-content`, `mm:minmax(0, 1fr)` |
|
|
837
|
-
| `gar` | `grid-auto-rows` | `mic:min-content`, `mac:max-content`, `mm:minmax(0, 1fr)` |
|
|
838
|
-
| `gaf` | `grid-auto-flow` | `r:row`, `c:column`, `d:dense`, `rd:row dense`, `cd:column dense` |
|
|
839
|
-
| `gap` | `gap` | - |
|
|
840
|
-
| `rgap` | `row-gap` | - |
|
|
841
|
-
| `colg` | `column-gap` | - |
|
|
842
|
-
| `ji` | `justify-items` | `n:normal`, `st:stretch`, `c:center`, `s:start`, `e:end`, `fs:flex-start`, `fe:flex-end`, `ss:self-start`, `se:self-end`, `l:left`, `r:right`, `b:baseline`, `fb:first baseline`, `lb:last baseline`, `lr:legacy right`, `ll:legacy left`, `lc:legacy center`, `sc:safe center`, `uc:unsafe center` |
|
|
843
|
-
| `js` | `justify-self` | `n:normal`, `st:stretch`, `c:center`, `s:start`, `e:end`, `fs:flex-start`, `fe:flex-end`, `ss:self-start`, `se:self-end`, `l:left`, `r:right`, `b:baseline`, `sc:safe center`, `uc:unsafe center` |
|
|
844
|
-
| `pli` | `place-items` | - |
|
|
845
|
-
| `pls` | `place-self` | - |
|
|
846
|
-
| `plc` | `place-content` | - |
|
|
847
|
-
|
|
848
|
-
---
|
|
849
|
-
|
|
850
|
-
## 8. Effects & Filters
|
|
851
|
-
|
|
852
|
-
### Opacity & Visibility
|
|
853
|
-
|
|
854
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
855
|
-
| -------- | ------------ | ---------------- |
|
|
856
|
-
| `opc` | `opacity` | - |
|
|
857
|
-
| `v` | `visibility` | `c:collapse` |
|
|
858
|
-
|
|
859
|
-
### Filter & Backdrop
|
|
860
|
-
|
|
861
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
862
|
-
| -------- | ----------------- | ---------------- |
|
|
863
|
-
| `flt` | `filter` | - |
|
|
864
|
-
| `bkdf` | `backdrop-filter` | - |
|
|
865
|
-
|
|
866
|
-
### Blend Modes
|
|
867
|
-
|
|
868
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
869
|
-
| -------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
870
|
-
| `mbd` | `mix-blend-mode` | `n:normal`, `m:multiply`, `s:screen`, `o:overlay`, `d:darken`, `l:lighten`, `cd:color-dodge`, `i:color-burn`, `hl:hard-light`, `sl:soft-light`, `di:difference`, `e:exclusion`, `h:hue`, `sa:saturation`, `c:color`, `lu:luminosity` |
|
|
871
|
-
|
|
872
|
-
### Box Shadow
|
|
873
|
-
|
|
874
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
875
|
-
| -------- | ------------ | ---------------- |
|
|
876
|
-
| `bxsh` | `box-shadow` | - |
|
|
877
|
-
| `bxshd` | `box-shadow` | - |
|
|
878
|
-
|
|
879
|
-
---
|
|
880
|
-
|
|
881
|
-
## 9. Transforms & Animations
|
|
882
|
-
|
|
883
|
-
### Transform
|
|
884
|
-
|
|
885
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
886
|
-
| -------- | ------------------ | ---------------- |
|
|
887
|
-
| `tra` | `transform` | - |
|
|
888
|
-
| `trab` | `transform-box` | - |
|
|
889
|
-
| `trao` | `transform-origin` | - |
|
|
890
|
-
| `tras` | `transform-style` | - |
|
|
891
|
-
| `rot` | `rotate` | - |
|
|
892
|
-
| `s` | `scale` | - |
|
|
893
|
-
| `trl` | `translate` | - |
|
|
894
|
-
|
|
895
|
-
### Transition
|
|
896
|
-
|
|
897
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
898
|
-
| --------- | ---------------------------- | ---------------- |
|
|
899
|
-
| `tran` | `transition` | - |
|
|
900
|
-
| `tranb` | `transition-behavior` | - |
|
|
901
|
-
| `trand` | `transition-delay` | - |
|
|
902
|
-
| `trandur` | `transition-duration` | - |
|
|
903
|
-
| `tranp` | `transition-property` | - |
|
|
904
|
-
| `trantf` | `transition-timing-function` | - |
|
|
905
|
-
|
|
906
|
-
### Animation
|
|
907
|
-
|
|
908
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
909
|
-
| -------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
910
|
-
| `ani` | `animation` | - |
|
|
911
|
-
| `anic` | `animation-composition` | `r:replace`, `a:add`, `ac:accumulate`, `ra:replace, add`, `aac:add, accumulate`, `raac:replace, add, accumulate` |
|
|
912
|
-
| `anide` | `animation-delay` | - |
|
|
913
|
-
| `anidi` | `animation-direction` | `r:reverse`, `a:alternate`, `ar:alternate-reverse`, `nr:normal, reverse`, `arn:alternate, reverse, normal` |
|
|
914
|
-
| `anidu` | `animation-duration` | - |
|
|
915
|
-
| `anifm` | `animation-fill-mode` | `f:forwards`, `b:backwards`, `nb:none, backwards`, `fbn:both, forwards, none` |
|
|
916
|
-
| `aniic` | `animation-iteration-count` | - |
|
|
917
|
-
| `anin` | `animation-name` | `s:slide` |
|
|
918
|
-
| `anips` | `animation-play-state` | `p:paused`, `r:running` |
|
|
919
|
-
| `anitf` | `animation-timing-function` | `ei:ease-in`, `eo:ease-out`, `eio:ease-in-out`, `l:linear`, `ss:step-start`, `se:step-end` |
|
|
920
|
-
|
|
921
|
-
---
|
|
922
|
-
|
|
923
|
-
## 10. Overflow & Scrolling
|
|
924
|
-
|
|
925
|
-
### Overflow
|
|
926
|
-
|
|
927
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
928
|
-
| -------- | ---------------------- | -------------------- |
|
|
929
|
-
| `ofl` | `overflow` | - |
|
|
930
|
-
| `oflx` | `overflow-x` | `c:clip`, `s:scroll` |
|
|
931
|
-
| `ofly` | `overflow-y` | `c:clip`, `s:scroll` |
|
|
932
|
-
| `oflb` | `overflow-block` | - |
|
|
933
|
-
| `ofli` | `overflow-inline` | - |
|
|
934
|
-
| `ofla` | `overflow-anchor` | - |
|
|
935
|
-
| `oflcm` | `overflow-clip-margin` | - |
|
|
936
|
-
| `oflw` | `overflow-wrap` | `c:clip`, `s:scroll` |
|
|
937
|
-
|
|
938
|
-
### Scroll
|
|
939
|
-
|
|
940
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
941
|
-
| -------- | ----------------------- | ---------------- |
|
|
942
|
-
| `scrb` | `scroll-behavior` | - |
|
|
943
|
-
| `scrm` | `scroll-margin` | - |
|
|
944
|
-
| `scrmb` | `scroll-margin-bottom` | - |
|
|
945
|
-
| `scrml` | `scroll-margin-left` | - |
|
|
946
|
-
| `scrmr` | `scroll-margin-right` | - |
|
|
947
|
-
| `scrmt` | `scroll-margin-top` | - |
|
|
948
|
-
| `scrp` | `scroll-padding` | - |
|
|
949
|
-
| `scrpb` | `scroll-padding-bottom` | - |
|
|
950
|
-
| `scrpl` | `scroll-padding-left` | - |
|
|
951
|
-
| `scrpr` | `scroll-padding-right` | - |
|
|
952
|
-
| `scrpt` | `scroll-padding-top` | - |
|
|
953
|
-
| `scrsa` | `scroll-snap-align` | - |
|
|
954
|
-
| `scrss` | `scroll-snap-stop` | - |
|
|
955
|
-
| `scrst` | `scroll-snap-type` | - |
|
|
956
|
-
| `sbc` | `scrollbar-color` | - |
|
|
957
|
-
| `sbg` | `scrollbar-gutter` | - |
|
|
958
|
-
| `sbw` | `scrollbar-width` | - |
|
|
959
|
-
|
|
960
|
-
### Overscroll
|
|
961
|
-
|
|
962
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
963
|
-
| -------- | ---------------------------- | ---------------- |
|
|
964
|
-
| `osrbh` | `overscroll-behavior` | `c:contain` |
|
|
965
|
-
| `osrbb` | `overscroll-behavior-block` | `c:contain` |
|
|
966
|
-
| `osrbi` | `overscroll-behavior-inline` | `c:contain` |
|
|
967
|
-
| `osrbx` | `overscroll-behavior-x` | `c:contain` |
|
|
968
|
-
| `orsby` | `overscroll-behavior-y` | `c:contain` |
|
|
969
|
-
|
|
970
|
-
---
|
|
971
|
-
|
|
972
|
-
## 11. Lists & Tables
|
|
973
|
-
|
|
974
|
-
### Lists
|
|
975
|
-
|
|
976
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
977
|
-
| -------- | --------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
978
|
-
| `ls` | `list-style` | `i:inside`, `di:disc`, `c:circle`, `s:square`, `de:decimal`, `g:georgian`, `tci:trad-chinese-informal`, `k:kannada` |
|
|
979
|
-
| `lsi` | `list-style-image` | - |
|
|
980
|
-
| `lisp` | `list-style-position` | `i:inside`, `o:outside` |
|
|
981
|
-
| `lst` | `list-style-type` | `di:disc`, `c:circle`, `s:square`, `de:decimal`, `g:georgian`, `tci:trad-chinese-informal`, `k:kannada` |
|
|
982
|
-
|
|
983
|
-
### Tables
|
|
984
|
-
|
|
985
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
986
|
-
| -------- | ----------------- | -------------------------- |
|
|
987
|
-
| `tbl` | `table-layout` | - |
|
|
988
|
-
| `bdcl` | `border-collapse` | `s:separate`, `c:collapse` |
|
|
989
|
-
| `bdsp` | `border-spacing` | - |
|
|
990
|
-
| `empc` | `empty-cells` | - |
|
|
991
|
-
| `caps` | `caption-side` | - |
|
|
992
|
-
|
|
993
|
-
### Columns
|
|
994
|
-
|
|
995
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
996
|
-
| -------- | ------------------- | ---------------- |
|
|
997
|
-
| `col` | `columns` | - |
|
|
998
|
-
| `colc` | `column-count` | - |
|
|
999
|
-
| `colf` | `column-fill` | - |
|
|
1000
|
-
| `colg` | `column-gap` | - |
|
|
1001
|
-
| `colr` | `column-rule` | - |
|
|
1002
|
-
| `colrc` | `column-rule-color` | - |
|
|
1003
|
-
| `colrs` | `column-rule-style` | - |
|
|
1004
|
-
| `colrw` | `column-rule-width` | - |
|
|
1005
|
-
| `cols` | `column-span` | - |
|
|
1006
|
-
| `colw` | `column-width` | - |
|
|
1007
|
-
|
|
1008
|
-
---
|
|
1009
|
-
|
|
1010
|
-
## 12. Advanced Properties
|
|
1011
|
-
|
|
1012
|
-
### Containment
|
|
1013
|
-
|
|
1014
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1015
|
-
| -------- | ------------------------------- | ---------------- |
|
|
1016
|
-
| `cnt` | `contain` | - |
|
|
1017
|
-
| `cntibs` | `contain-intrinsic-block-size` | - |
|
|
1018
|
-
| `cntih` | `contain-intrinsic-height` | - |
|
|
1019
|
-
| `cntiis` | `contain-intrinsic-inline-size` | - |
|
|
1020
|
-
| `cntis` | `contain-intrinsic-size` | - |
|
|
1021
|
-
| `ciw` | `contain-intrinsic-width` | - |
|
|
1022
|
-
|
|
1023
|
-
### Container Queries
|
|
1024
|
-
|
|
1025
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1026
|
-
| -------- | ---------------- | ---------------- |
|
|
1027
|
-
| `ctr` | `container` | - |
|
|
1028
|
-
| `ctrn` | `container-name` | - |
|
|
1029
|
-
| `ctrt` | `container-type` | - |
|
|
1030
|
-
|
|
1031
|
-
### Content & Counters
|
|
1032
|
-
|
|
1033
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1034
|
-
| -------- | ------------------- | ---------------- |
|
|
1035
|
-
| `ctt` | `content` | - |
|
|
1036
|
-
| `cntri` | `counter-increment` | - |
|
|
1037
|
-
| `cntrr` | `counter-reset` | - |
|
|
1038
|
-
| `cntrs` | `counter-set` | - |
|
|
1039
|
-
|
|
1040
|
-
### Page Breaks
|
|
1041
|
-
|
|
1042
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1043
|
-
| -------- | ------------------- | ---------------- |
|
|
1044
|
-
| `pg` | `page` | - |
|
|
1045
|
-
| `pgba` | `page-break-after` | - |
|
|
1046
|
-
| `pgbb` | `page-break-before` | - |
|
|
1047
|
-
| `pgbi` | `page-break-inside` | - |
|
|
1048
|
-
| `brka` | `break-after` | - |
|
|
1049
|
-
| `brkb` | `break-before` | - |
|
|
1050
|
-
| `brki` | `break-inside` | - |
|
|
1051
|
-
|
|
1052
|
-
### Other Advanced
|
|
1053
|
-
|
|
1054
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1055
|
-
| -------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1056
|
-
| `a` | `all` | - |
|
|
1057
|
-
| `is` | `isolation` | `i:isolate` |
|
|
1058
|
-
| `z` | `z-index` | - |
|
|
1059
|
-
| `ord` | `order` | - |
|
|
1060
|
-
| `fl` | `float` | `is:inline-start`, `ie:inline-end`, `r:right`, `l:left` |
|
|
1061
|
-
| `clr` | `clear` | - |
|
|
1062
|
-
| `rsz` | `resize` | `b:both`, `h:horizontal`, `v:vertical` |
|
|
1063
|
-
| `us` | `user-select` | `t:text`, `all:all`, `c:contain` |
|
|
1064
|
-
| `pe` | `pointer-events` | - |
|
|
1065
|
-
| `cr` | `cursor` | `p:pointer`, `d:default`, `cm:context-menu`, `h:help`, `pg:progress`, `w:wait`, `c:cell`, `t:text`, `vt:vertical-text`, `al:alias`, `cp:copy`, `mo:move`, `nd:no-drop`, `na:not-allowed`, `gr:grab`, `gb:grabbing`, `as:all-scroll`, `colr:col-resize`, `rr:row-resize`, `nr:n-resize`, `er:e-resize`, `sr:s-resize`, `wr:w-resize`, `ner:ne-resize`, `ser:se-resize`, `swr:sw-resize`, `ewr:ew-resize`, `nsr:ns-resize`, `nesw:nesw-resize`, `nwse:nwse-resize`, `zi:zoom-in`, `zo:zoom-out` |
|
|
1066
|
-
| `toa` | `touch-action` | `p:pan-x`, `py:pan-y`, `pm:pan-x pan-y`, `pi:pinch-zoom` |
|
|
1067
|
-
| `zo` | `zoom` | - |
|
|
1068
|
-
|
|
1069
|
-
---
|
|
1070
|
-
|
|
1071
|
-
## 13. WebKit Specific
|
|
1072
|
-
|
|
1073
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1074
|
-
| -------- | --------------------------- | --------------------- |
|
|
1075
|
-
| `wlc` | `-webkit-line-clamp` | - |
|
|
1076
|
-
| `wtfc` | `-webkit-text-fill-color` | - |
|
|
1077
|
-
| `wts` | `-webkit-text-stroke` | - |
|
|
1078
|
-
| `wtsc` | `-webkit-text-stroke-color` | - |
|
|
1079
|
-
| `wtsw` | `-webkit-text-stroke-width` | `m:medium`, `t:thick` |
|
|
1080
|
-
|
|
1081
|
-
---
|
|
1082
|
-
|
|
1083
|
-
## 14. Special Values
|
|
1084
|
-
|
|
1085
|
-
### Common Values
|
|
1086
|
-
|
|
1087
|
-
- `n` = `none`
|
|
1088
|
-
- `nm` = `normal`
|
|
1089
|
-
- `a` = `auto`
|
|
1090
|
-
- `i` = `inherit`
|
|
1091
|
-
- `in` = `initial`
|
|
1092
|
-
- `is` = `inline-start`
|
|
1093
|
-
- `ie` = `inline-end`
|
|
1094
|
-
- `tr` = `transparent`
|
|
1095
|
-
- `c` = `center`
|
|
1096
|
-
- `cl` = `collapse`
|
|
1097
|
-
- `l` = `left`
|
|
1098
|
-
- `r` = `right`
|
|
1099
|
-
- `h` = `hidden`
|
|
1100
|
-
- `v` = `visible`
|
|
1101
|
-
- `s` = `start`
|
|
1102
|
-
- `e` = `end`
|
|
1103
|
-
- `t` = `top`
|
|
1104
|
-
- `b` = `bottom`
|
|
1105
|
-
- `bs` = `block-start`
|
|
1106
|
-
- `be` = `block-end`
|
|
1107
|
-
|
|
1108
|
-
### Size Values
|
|
1109
|
-
|
|
1110
|
-
- `t` = `thin`
|
|
1111
|
-
- `m` = `medium`
|
|
1112
|
-
- `th` = `thick`
|
|
1113
|
-
|
|
1114
|
-
### Style Values
|
|
1115
|
-
|
|
1116
|
-
- `s` = `solid`
|
|
1117
|
-
- `d` = `dotted`
|
|
1118
|
-
- `ds` = `dashed`
|
|
1119
|
-
- `db` = `double`
|
|
1120
|
-
- `g` = `groove`
|
|
1121
|
-
- `r` = `ridge`
|
|
1122
|
-
- `i` = `inset`
|
|
1123
|
-
- `o` = `outset`
|
|
1124
|
-
|
|
1125
|
-
---
|
|
1126
|
-
|
|
1127
|
-
_Bảng tra cứu này bao gồm tất cả 409 thuộc tính CSS và giá trị viết tắt được hỗ trợ trong xCSS. Để sử dụng, hãy kết hợp viết tắt thuộc tính với giá trị viết tắt theo cú pháp: `[MQ:][layer]<property><value>[@selector]` (lưu ý: `<property><value>` là bắt buộc)_
|
|
1128
|
-
|
|
1129
|
-
# Hướng dẫn sử dụng xCSS
|
|
1130
|
-
|
|
1131
|
-
xCSS là một hệ thống CSS-in-JS cho phép bạn viết CSS ngắn gọn và hiệu quả thông qua các class name đặc biệt. Sau khi học, bạn sẽ:
|
|
1132
|
-
|
|
1133
|
-
- Đọc/viết class theo công thức và hiểu nó biến thành CSS như thế nào
|
|
1134
|
-
- Kiểm soát **media query**, **@layer**, **!important**, **selector** giả (pseudo) và tổ hợp nhiều thuộc tính trong **một class**
|
|
1135
|
-
|
|
1136
|
-
> **Lưu ý**: Danh sách viết tắt thuộc tính và giá trị sẽ có ở **phần sau**.
|
|
1137
|
-
|
|
1138
|
-
## Cú pháp tổng quát
|
|
1139
|
-
|
|
1140
|
-
```
|
|
1141
|
-
[MQ:][layer]<property><value>[@selector]
|
|
1142
|
-
```
|
|
1143
|
-
|
|
1144
|
-
**Lưu ý quan trọng**: `<property><value>` là **bắt buộc** - phải có cả thuộc tính CSS và giá trị CSS.
|
|
1145
|
-
|
|
1146
|
-
**Ví dụ cú pháp đúng:**
|
|
1147
|
-
|
|
1148
|
-
- `cRed` - Màu đỏ (layer 0)
|
|
1149
|
-
- `5cRed` - Màu đỏ ở layer 5
|
|
1150
|
-
- `md:cRed` - Màu đỏ trên màn hình trung bình
|
|
1151
|
-
- `md:5cRed` - Màu đỏ ở layer 5 trên màn hình trung bình
|
|
1152
|
-
|
|
1153
|
-
### Các thành phần:
|
|
1154
|
-
|
|
1155
|
-
#### 1. Media Query (MQ) - Tùy chọn
|
|
1156
|
-
|
|
1157
|
-
- `xs:` - Màn hình nhỏ (max-width: 575px)
|
|
1158
|
-
- `sm:` - Màn hình nhỏ (min-width: 576px)
|
|
1159
|
-
- `md:` - Màn hình trung bình (min-width: 768px)
|
|
1160
|
-
- `lg:` - Màn hình lớn (min-width: 992px)
|
|
1161
|
-
- `xl:` - Màn hình rất lớn (min-width: 1200px)
|
|
1162
|
-
- `2xl:` - Màn hình cực lớn (min-width: 1400px)
|
|
1163
|
-
- `sma:` - Màn hình nhỏ trở xuống (max-width: 768px)
|
|
1164
|
-
- `mda:` - Màn hình trung bình trở xuống (max-width: 992px)
|
|
1165
|
-
- `lga:` - Màn hình lớn trở xuống (max-width: 1200px)
|
|
1166
|
-
- `xla:` - Màn hình rất lớn trở xuống (max-width: 1400px)
|
|
1167
|
-
|
|
1168
|
-
#### 2. Layer - Tùy chọn
|
|
1169
|
-
|
|
1170
|
-
- `1` đến `19` - Thứ tự ưu tiên CSS layer (số càng cao ưu tiên càng cao)
|
|
1171
|
-
- Mặc định: `0` (layer 0)
|
|
1172
|
-
- Mục đích: gom nhóm quy tắc theo tầng (base, component, utilities, overrides…)
|
|
1173
|
-
|
|
1174
|
-
#### 3. Property (Thuộc tính) - **BẮT BUỘC**
|
|
1175
|
-
|
|
1176
|
-
- Viết thường, có thể là tên đầy đủ hoặc viết tắt
|
|
1177
|
-
- Không có dấu `-` trừ trường hợp có thuộc tính có dấu trừ thường bắt đầu `-w`
|
|
1178
|
-
- Ví dụ: `w` (width), `h` (height), `c` (color), `bg` (background)
|
|
1179
|
-
|
|
1180
|
-
#### 4. Value (Giá trị) - **BẮT BUỘC**
|
|
1181
|
-
|
|
1182
|
-
- **Số**: `10`, `-4.5`, `0.5`, có thể kèm **đơn vị**: `10px`, `1.5rem`, `100%`
|
|
1183
|
-
- **Giá trị đặt tên** bắt đầu bằng **chữ hoa**: `Red`, `Center`, `Block`, `Fixed`, `None`
|
|
1184
|
-
- **Giá trị trong ngoặc nhọn** để ghi **nguyên văn**: `c{rgb(255,0,0)}`, `bg{linear-gradient(...)}`
|
|
1185
|
-
- **Biến CSS**: bắt đầu bằng `--`: `c--primary` → `color: var(--primary)`
|
|
1186
|
-
- **Quan trọng**: thêm `!` ngay trước giá trị để ra `!important`: `w!10px` → `width: 10px !important`
|
|
1187
|
-
- **Hàm**: dùng dạng **TitleCase** + `(...)` và dùng dấu `;` thay cho khoảng trắng:
|
|
1188
|
-
- `wCalc(100%;-;20px)` → `width: calc(100% - 20px)`
|
|
1189
|
-
- `tTranslate(50%;,;-50%)` → `transform: translate(50% , -50%)`
|
|
1190
|
-
|
|
1191
|
-
#### 5. Selector - Tùy chọn
|
|
1192
|
-
|
|
1193
|
-
- Bắt đầu bằng `@`
|
|
1194
|
-
- Dấu `;` thay thế cho dấu cách
|
|
1195
|
-
- Có thể dùng giả lớp/giả phần tử, chọn phần tử con, hoặc kết hợp
|
|
1196
|
-
- Ví dụ: `@:hover`, `@:focus`, `@:active`, `@>a`, `@.btn;:hover`
|
|
1197
|
-
|
|
1198
|
-
## Ví dụ sử dụng
|
|
1199
|
-
|
|
1200
|
-
### Cơ bản
|
|
1201
|
-
|
|
1202
|
-
```html
|
|
1203
|
-
<!-- Màu đỏ -->
|
|
1204
|
-
<div class="cRed">Văn bản màu đỏ</div>
|
|
1205
|
-
|
|
1206
|
-
<!-- Chiều rộng 100px -->
|
|
1207
|
-
<div class="w100px">Chiều rộng 100px</div>
|
|
1208
|
-
|
|
1209
|
-
<!-- Padding 20px -->
|
|
1210
|
-
<div class="p20px">Padding 20px</div>
|
|
1211
|
-
|
|
1212
|
-
<!-- Opacity 50% -->
|
|
1213
|
-
<div class="opc50%">Độ trong suốt 50%</div>
|
|
1214
|
-
|
|
1215
|
-
<!-- Font size 14px -->
|
|
1216
|
-
<div class="fns14px">Cỡ chữ 14px</div>
|
|
1217
|
-
```
|
|
1218
|
-
|
|
1219
|
-
### Với Media Query
|
|
1220
|
-
|
|
1221
|
-
```html
|
|
1222
|
-
<!-- Màu đỏ trên màn hình lớn -->
|
|
1223
|
-
<div class="lg:cRed">Màu đỏ trên desktop</div>
|
|
1224
|
-
|
|
1225
|
-
<!-- Ẩn trên màn hình nhỏ -->
|
|
1226
|
-
<div class="xs:vHidden">Ẩn trên mobile</div>
|
|
1227
|
-
|
|
1228
|
-
<!-- Responsive width -->
|
|
1229
|
-
<div class="w100% md:w50% lg:w33%">Responsive width</div>
|
|
6
|
+
```bash
|
|
7
|
+
npm i @fwkui/x-css
|
|
1230
8
|
```
|
|
1231
9
|
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
```html
|
|
1235
|
-
<!-- Layer ưu tiên cao -->
|
|
1236
|
-
<div class="5cRed">Màu đỏ ưu tiên cao</div>
|
|
1237
|
-
|
|
1238
|
-
<!-- Layer ưu tiên thấp -->
|
|
1239
|
-
<div class="1cBlue">Màu xanh ưu tiên thấp</div>
|
|
1240
|
-
|
|
1241
|
-
<!-- Kết hợp layer và media query -->
|
|
1242
|
-
<div class="md:7cGreen">Màu xanh layer 7 trên desktop</div>
|
|
1243
|
-
```
|
|
1244
|
-
|
|
1245
|
-
### Với Selector
|
|
1246
|
-
|
|
1247
|
-
```html
|
|
1248
|
-
<!-- Hover effect -->
|
|
1249
|
-
<div class="cRed@:hover">Đỏ khi hover</div>
|
|
1250
|
-
|
|
1251
|
-
<!-- Focus effect -->
|
|
1252
|
-
<input class="bdw2px@:focus" placeholder="Border khi focus" />
|
|
1253
|
-
|
|
1254
|
-
<!-- Child selector -->
|
|
1255
|
-
<div class="cBlue@>a">Màu xanh cho thẻ con a</div>
|
|
1256
|
-
|
|
1257
|
-
<!-- Complex selector -->
|
|
1258
|
-
<div class="cRed@.btn;:hover">Màu đỏ khi hover button</div>
|
|
1259
|
-
```
|
|
1260
|
-
|
|
1261
|
-
### Với giá trị đặc biệt
|
|
1262
|
-
|
|
1263
|
-
```html
|
|
1264
|
-
<!-- !important -->
|
|
1265
|
-
<div class="c!red">Màu đỏ !important</div>
|
|
1266
|
-
|
|
1267
|
-
<!-- CSS Variable -->
|
|
1268
|
-
<div class="c--primary">Màu từ CSS variable</div>
|
|
1269
|
-
|
|
1270
|
-
<!-- Giá trị tùy chỉnh -->
|
|
1271
|
-
<div class="w{calc(100%;-;20px)}">Chiều rộng tính toán</div>
|
|
1272
|
-
|
|
1273
|
-
<!-- Hàm CSS -->
|
|
1274
|
-
<div class="wClamp(280px;640px;100%)">Width với clamp</div>
|
|
1275
|
-
|
|
1276
|
-
<!-- Box shadow phức tạp -->
|
|
1277
|
-
<div class="bxsh{0;2px;8px;rgba(0,0,0,.1)}">Shadow phức tạp</div>
|
|
1278
|
-
```
|
|
1279
|
-
|
|
1280
|
-
### Kết hợp nhiều thuộc tính với `&`
|
|
1281
|
-
|
|
1282
|
-
```html
|
|
1283
|
-
<!-- Nhiều thuộc tính cùng lúc -->
|
|
1284
|
-
<div class="cRed&fw700&taC">Màu đỏ, font-weight 700, căn giữa</div>
|
|
1285
|
-
|
|
1286
|
-
<!-- Flexbox layout -->
|
|
1287
|
-
<div class="dF&aiC&jcSp">Flexbox center và space-between</div>
|
|
1288
|
-
|
|
1289
|
-
<!-- Padding và margin -->
|
|
1290
|
-
<div class="p8px&m0">Padding 8px và margin 0</div>
|
|
1291
|
-
|
|
1292
|
-
<!-- Kết hợp với selector -->
|
|
1293
|
-
<div class="cRed&fw700@:hover">Màu đỏ và font-weight 700 khi hover</div>
|
|
1294
|
-
```
|
|
1295
|
-
|
|
1296
|
-
## Quy tắc ưu tiên & va chạm
|
|
1297
|
-
|
|
1298
|
-
1. **@layer**: lớp số lớn thắng lớp số nhỏ (khi cùng nguồn gốc/specificity)
|
|
1299
|
-
2. **Specificity** của selector: selector cụ thể hơn thắng
|
|
1300
|
-
3. **Thứ tự xuất hiện** trong cùng layer và cùng specificity
|
|
1301
|
-
4. **!important** luôn thắng các quy tắc thường trong cùng phạm vi cascade
|
|
1302
|
-
|
|
1303
|
-
Ví dụ: `5cBlue` vs `9cRed` → `9cRed` thắng. Nhưng `5cBlue!` (viết `c!Blue` hoặc `c!{blue}`) có thể tiếp tục thắng nếu cùng layer/scope.
|
|
1304
|
-
|
|
1305
|
-
## Quy tắc quan trọng
|
|
1306
|
-
|
|
1307
|
-
### ✅ Hợp lệ
|
|
1308
|
-
|
|
1309
|
-
- `cRed` - Màu đỏ (property: `c`, value: `Red`)
|
|
1310
|
-
- `w10px` - Chiều rộng 10px (property: `w`, value: `10px`)
|
|
1311
|
-
- `md:cRed` - Màu đỏ trên màn hình trung bình (MQ: `md`, property: `c`, value: `Red`)
|
|
1312
|
-
- `2w100px` - Chiều rộng 100px ở layer 2 (layer: `2`, property: `w`, value: `100px`)
|
|
1313
|
-
- `cRed@:hover` - Màu đỏ khi hover (property: `c`, value: `Red`, selector: `@:hover`)
|
|
1314
|
-
- `w!100px` - Chiều rộng 100px !important (property: `w`, value: `!100px`)
|
|
1315
|
-
- `c{red}` - Màu đỏ với giá trị tùy chỉnh (property: `c`, value: `{red}`)
|
|
1316
|
-
- `cRed&w700` - Kết hợp nhiều thuộc tính (property: `c`, value: `Red`, property: `w`, value: `700`)
|
|
1317
|
-
- `wCalc(100%;-;20px)` - Hàm CSS với dấu `;` (property: `w`, value: `Calc(100%;-;20px)`)
|
|
1318
|
-
|
|
1319
|
-
### ❌ Không hợp lệ
|
|
1320
|
-
|
|
1321
|
-
- `Cred` - Chữ C viết hoa ở thuộc tính (property phải viết thường)
|
|
1322
|
-
- `C{red}` - Chữ C viết hoa ở thuộc tính (property phải viết thường)
|
|
1323
|
-
- `cRed}` - Thiếu dấu mở ngoặc (syntax lỗi)
|
|
1324
|
-
- `c-red` - Dấu gạch ngang không được phép (property không được có dấu `-`)
|
|
1325
|
-
- `W-10px` - Chữ W viết hoa và dấu gạch ngang (property phải viết thường)
|
|
1326
|
-
- `w-!10px` - Dấu gạch ngang không được phép (property không được có dấu `-`)
|
|
1327
|
-
- `cRed @:hover` - Có dấu cách trong class name (không được có dấu cách)
|
|
1328
|
-
- `c` - Thiếu value (bắt buộc phải có cả property và value)
|
|
1329
|
-
- `Red` - Thiếu property (bắt buộc phải có cả property và value)
|
|
1330
|
-
|
|
1331
|
-
## Lỗi phổ biến & cách tránh
|
|
1332
|
-
|
|
1333
|
-
- **Dùng chữ hoa ở đầu thuộc tính** → sai. Thuộc tính (**property**) phải là **chữ thường** hoặc `--var`
|
|
1334
|
-
- **Thiếu property hoặc value** → sai. Cả hai đều **bắt buộc** phải có
|
|
1335
|
-
- **Nhầm dấu `-` và `!`**: `w-!10px` là lỗi. Hãy dùng `w!10px`
|
|
1336
|
-
- **Quên `;` trong giá trị có khoảng trắng**: `ff{Courier New}` → nên viết `ff{Courier;New}`
|
|
1337
|
-
- **Selector có khoảng trắng** phải dùng `;` và sẽ được đổi lại khi xuất
|
|
1338
|
-
- **Không có bảng viết tắt** → trình biên dịch không biết dịch `ta` thành `text-align`
|
|
1339
|
-
|
|
1340
|
-
## Lưu ý
|
|
1341
|
-
|
|
1342
|
-
1. **Property và Value bắt buộc** - Mỗi class phải có cả thuộc tính và giá trị CSS
|
|
1343
|
-
2. **Tên class phải viết thường** - Chỉ property viết thường, value có thể có ký tự HOA
|
|
1344
|
-
3. **Không dùng dấu cách** - Dùng dấu `;` thay thế
|
|
1345
|
-
4. **CSS.supports validation** - Tất cả class phải được CSS hỗ trợ
|
|
1346
|
-
5. **Thứ tự ưu tiên** - Layer số cao hơn sẽ có ưu tiên cao hơn
|
|
1347
|
-
6. **Media Query** - Chỉ áp dụng trong khoảng màn hình tương ứng
|
|
1348
|
-
7. **Khoảng trắng trong giá trị** dùng dấu `;`. Ví dụ: `ff{Courier;New;monospace}` → `font-family: Courier New, monospace`
|
|
1349
|
-
|
|
1350
|
-
## Lời khuyên từ kinh nghiệm thực tế
|
|
1351
|
-
|
|
1352
|
-
### 🎯 **Nguyên tắc đặt tên class**
|
|
1353
|
-
|
|
1354
|
-
#### ✅ **Nên làm:**
|
|
1355
|
-
|
|
1356
|
-
- **Ngắn gọn, dễ đọc**: `cRed`, `w100px`, `p16px`
|
|
1357
|
-
- **Sử dụng viết tắt chuẩn**: `dF` thay vì `displayFlex` (d: display, F: Flex)
|
|
1358
|
-
|
|
1359
|
-
#### ❌ **Tránh:**
|
|
1360
|
-
|
|
1361
|
-
- **Tên quá dài**: `wCalc(100%;-;20px;-;30px;-;10px)` → nên dùng CSS variable
|
|
1362
|
-
- **Giá trị phức tạp**: `bxsh{0;4px;8px;12px;rgba(0,0,0,0.1);inset}` → nên định nghĩa qua biến
|
|
1363
|
-
- **Thuộc tính lặp lại**: `cRed`, `cBlue`, `cGreen` → nên dùng color palette
|
|
1364
|
-
|
|
1365
|
-
### 🎨 **Quản lý giá trị phức tạp**
|
|
1366
|
-
|
|
1367
|
-
#### **Sử dụng CSS Variables cho giá trị dài:**
|
|
1368
|
-
|
|
1369
|
-
```css
|
|
1370
|
-
:root {
|
|
1371
|
-
--shadow-card: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
1372
|
-
--shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.15);
|
|
1373
|
-
--border-radius: 8px;
|
|
1374
|
-
--spacing-sm: 8px;
|
|
1375
|
-
--spacing-md: 16px;
|
|
1376
|
-
--spacing-lg: 24px;
|
|
1377
|
-
}
|
|
1378
|
-
```
|
|
1379
|
-
|
|
1380
|
-
```html
|
|
1381
|
-
<!-- Thay vì viết dài -->
|
|
1382
|
-
<div class="bxsh{0;4px;8px;rgba(0,0,0,0.1)} bdra8px p16px">
|
|
1383
|
-
<!-- Nên dùng biến -->
|
|
1384
|
-
<div class="bxsh--shadow-card bdra--border-radius p--spacing-md"></div>
|
|
1385
|
-
</div>
|
|
1386
|
-
```
|
|
1387
|
-
|
|
1388
|
-
#### **Tạo component classes cho pattern thường dùng:**
|
|
1389
|
-
|
|
1390
|
-
```html
|
|
1391
|
-
<!-- Thay vì lặp lại nhiều lần -->
|
|
1392
|
-
<div class="dF&aiC&jcSp&p16px&bgcWhite&bxsh{0;2px;4px;rgba(0,0,0,0.1)}">
|
|
1393
|
-
<!-- Nên tạo component class -->
|
|
1394
|
-
<div class="card"></div>
|
|
1395
|
-
</div>
|
|
1396
|
-
```
|
|
1397
|
-
|
|
1398
|
-
### 📱 **Responsive Design Best Practices**
|
|
1399
|
-
|
|
1400
|
-
#### **Sử dụng mobile-first approach:**
|
|
1401
|
-
|
|
1402
|
-
```html
|
|
1403
|
-
<!-- Base styles cho mobile -->
|
|
1404
|
-
<div class="w100% p8px">
|
|
1405
|
-
<!-- Override cho desktop -->
|
|
1406
|
-
<div class="md:w50% md:p16px lg:w33% lg:p24px"></div>
|
|
1407
|
-
</div>
|
|
1408
|
-
```
|
|
1409
|
-
|
|
1410
|
-
#### **Nhóm breakpoints logic:**
|
|
1411
|
-
|
|
10
|
+
## Sử dụng nhanh (vanilla/HTML)
|
|
1412
11
|
```html
|
|
1413
|
-
|
|
1414
|
-
<
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
<!-- Typography responsive -->
|
|
1418
|
-
<div class="fns14px md:fns16px lg:fns18px"></div>
|
|
1419
|
-
</div>
|
|
1420
|
-
</div>
|
|
1421
|
-
```
|
|
1422
|
-
|
|
1423
|
-
### 🎭 **Layer Management**
|
|
1424
|
-
|
|
1425
|
-
#### **Tổ chức layers theo hierarchy:**
|
|
1426
|
-
|
|
1427
|
-
```html
|
|
1428
|
-
<!-- Base styles (0) -->
|
|
1429
|
-
<div class="cBlack fns16px">
|
|
1430
|
-
<!-- Component styles (1-5) -->
|
|
1431
|
-
<div class="2btnPrimary">
|
|
1432
|
-
<!-- Utility styles (6-10) -->
|
|
1433
|
-
<div class="8m16px">
|
|
1434
|
-
<!-- Override styles (11-19) -->
|
|
1435
|
-
<div class="15cRed"></div>
|
|
1436
|
-
</div>
|
|
1437
|
-
</div>
|
|
1438
|
-
</div>
|
|
1439
|
-
```
|
|
1440
|
-
|
|
1441
|
-
### 🔧 **Performance Tips**
|
|
1442
|
-
|
|
1443
|
-
#### **Tránh over-engineering:**
|
|
1444
|
-
|
|
1445
|
-
```html
|
|
1446
|
-
<!-- Đơn giản và hiệu quả -->
|
|
1447
|
-
<div class="dF&aiC&p16px">
|
|
1448
|
-
<!-- Thay vì phức tạp không cần thiết -->
|
|
1449
|
-
<div class="dF&aiC&jcC&p16px&m0&b0&bgcT"></div>
|
|
1450
|
-
</div>
|
|
1451
|
-
```
|
|
1452
|
-
|
|
1453
|
-
#### **Sử dụng shorthand khi có thể:**
|
|
1454
|
-
|
|
1455
|
-
```html
|
|
1456
|
-
<!-- Margin shorthand -->
|
|
1457
|
-
<div class="m16px">
|
|
1458
|
-
<!-- margin: 16px -->
|
|
1459
|
-
<div class="mt8px&mb8px">
|
|
1460
|
-
<!-- margin-top: 8px; margin-bottom: 8px -->
|
|
1461
|
-
|
|
1462
|
-
<!-- Padding shorthand -->
|
|
1463
|
-
<div class="p16px">
|
|
1464
|
-
<!-- padding: 16px -->
|
|
1465
|
-
<div class="px16px&py8px"><!-- padding: 8px 16px --></div>
|
|
1466
|
-
</div>
|
|
1467
|
-
</div>
|
|
1468
|
-
</div>
|
|
1469
|
-
```
|
|
1470
|
-
|
|
1471
|
-
### 🎨 **Design System Integration**
|
|
1472
|
-
|
|
1473
|
-
#### **Tạo design tokens:**
|
|
1474
|
-
|
|
1475
|
-
```css
|
|
1476
|
-
:root {
|
|
1477
|
-
/* Colors */
|
|
1478
|
-
--color-primary: #0070f3;
|
|
1479
|
-
--color-secondary: #7928ca;
|
|
1480
|
-
--color-success: #0070f3;
|
|
1481
|
-
--color-warning: #f5a623;
|
|
1482
|
-
--color-error: #e00;
|
|
1483
|
-
|
|
1484
|
-
/* Spacing scale */
|
|
1485
|
-
--space-1: 4px;
|
|
1486
|
-
--space-2: 8px;
|
|
1487
|
-
--space-3: 12px;
|
|
1488
|
-
--space-4: 16px;
|
|
1489
|
-
--space-5: 20px;
|
|
1490
|
-
--space-6: 24px;
|
|
1491
|
-
|
|
1492
|
-
/* Typography scale */
|
|
1493
|
-
--text-xs: 12px;
|
|
1494
|
-
--text-sm: 14px;
|
|
1495
|
-
--text-base: 16px;
|
|
1496
|
-
--text-lg: 18px;
|
|
1497
|
-
--text-xl: 20px;
|
|
1498
|
-
}
|
|
1499
|
-
```
|
|
12
|
+
<!doctype html>
|
|
13
|
+
<html>
|
|
14
|
+
<body>
|
|
15
|
+
<div id="card" class="bgc#fff p10">Card</div>
|
|
1500
16
|
|
|
1501
|
-
|
|
17
|
+
<script type="module">
|
|
18
|
+
import { cssObserve, cssClsx } from "./src/index.js";
|
|
1502
19
|
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
<div class="cError"></div>
|
|
1510
|
-
</div>
|
|
1511
|
-
</div>
|
|
1512
|
-
</div>
|
|
20
|
+
const clsx = cssClsx(document);
|
|
21
|
+
document.querySelector("#card").className = clsx("bgc#fff", "p10");
|
|
22
|
+
cssObserve(document);
|
|
23
|
+
</script>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
1513
26
|
```
|
|
1514
27
|
|
|
1515
|
-
|
|
28
|
+
## Sử dụng voi React
|
|
29
|
+
```jsx
|
|
30
|
+
import { useEffect, useMemo } from "react";
|
|
31
|
+
import { xcss } from "@fwkui/x-css";
|
|
1516
32
|
|
|
1517
|
-
|
|
33
|
+
export default function Card() {
|
|
34
|
+
const engine = useMemo(() => xcss().buildCss(document), []);
|
|
1518
35
|
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
<!-- Variants: btnSecondary, btnDanger, btnGhost -->
|
|
1523
|
-
<button class="btnPrimary">Click me</button>
|
|
1524
|
-
```
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
engine?.observe();
|
|
38
|
+
}, [engine]);
|
|
1525
39
|
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
<!-- Layout -->
|
|
1530
|
-
<div class="container">
|
|
1531
|
-
<div class="row">
|
|
1532
|
-
<div class="col">
|
|
1533
|
-
<!-- Components -->
|
|
1534
|
-
<div class="card">
|
|
1535
|
-
<div class="btn">
|
|
1536
|
-
<div class="input">
|
|
1537
|
-
<!-- Utilities -->
|
|
1538
|
-
<div class="textCenter">
|
|
1539
|
-
<div class="mAuto">
|
|
1540
|
-
<div class="dNone"></div>
|
|
1541
|
-
</div>
|
|
1542
|
-
</div>
|
|
1543
|
-
</div>
|
|
1544
|
-
</div>
|
|
1545
|
-
</div>
|
|
40
|
+
return (
|
|
41
|
+
<div className={engine?.clsx("bgc#fff", "p10") ?? "bgc#fff p10"}>
|
|
42
|
+
Card
|
|
1546
43
|
</div>
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
```
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
}
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
.
|
|
1607
|
-
color: #fff;
|
|
1608
|
-
}
|
|
1609
|
-
.bgc\#0070f3 {
|
|
1610
|
-
background-color: #0070f3;
|
|
1611
|
-
}
|
|
1612
|
-
```
|
|
1613
|
-
|
|
1614
|
-
## Bảng tra cứu nhanh
|
|
1615
|
-
|
|
1616
|
-
### Media Query
|
|
1617
|
-
|
|
1618
|
-
| Ký hiệu | Kích thước màn hình |
|
|
1619
|
-
| ------- | ------------------- |
|
|
1620
|
-
| `xs:` | ≤ 575px |
|
|
1621
|
-
| `sm:` | ≥ 576px |
|
|
1622
|
-
| `md:` | ≥ 768px |
|
|
1623
|
-
| `lg:` | ≥ 992px |
|
|
1624
|
-
| `xl:` | ≥ 1200px |
|
|
1625
|
-
| `2xl:` | ≥ 1400px |
|
|
1626
|
-
|
|
1627
|
-
### Layer
|
|
1628
|
-
|
|
1629
|
-
| Ký hiệu | Mô tả |
|
|
1630
|
-
| ------- | ---------------------------------------------- |
|
|
1631
|
-
| `0` | Layer mặc định (ưu tiên thấp) |
|
|
1632
|
-
| `1-19` | Layer tùy chỉnh (số càng cao ưu tiên càng cao) |
|
|
1633
|
-
|
|
1634
|
-
### Giá trị đặc biệt
|
|
1635
|
-
|
|
1636
|
-
| Ký hiệu | Ý nghĩa |
|
|
1637
|
-
| ------- | ----------------- |
|
|
1638
|
-
| `!` | !important |
|
|
1639
|
-
| `--` | CSS Variable |
|
|
1640
|
-
| `{}` | Giá trị tùy chỉnh |
|
|
1641
|
-
| `;` | Thay thế dấu cách |
|
|
1642
|
-
|
|
1643
|
-
## Câu hỏi thường gặp (FAQ)
|
|
1644
|
-
|
|
1645
|
-
**Hỏi:** Tại sao phải viết hoa chữ cái đầu giá trị dạng từ khoá?
|
|
1646
|
-
|
|
1647
|
-
**Đáp:** Để phân biệt **p** (thuộc tính viết thường) và **v** (giá trị đặt tên). Tránh nhầm `red` (giá trị) với một thuộc tính giả định.
|
|
1648
|
-
|
|
1649
|
-
**Hỏi:** Dùng dấu gì cho khoảng trắng?
|
|
1650
|
-
|
|
1651
|
-
**Đáp:** Dùng dấu `;` trong **giá trị** và **selector** để không phá vỡ tên class.
|
|
1652
|
-
|
|
1653
|
-
**Hỏi:** Tôi muốn thêm breakpoint mới?
|
|
1654
|
-
|
|
1655
|
-
**Đáp:** Bổ sung mã tiền tố (ví dụ `xxl:`) và map sang `@media (min-width: …)` trong cấu hình biên dịch.
|
|
1656
|
-
|
|
1657
|
-
**Hỏi:** Có cần escape khi viết trong HTML?
|
|
1658
|
-
|
|
1659
|
-
**Đáp:** Không. Bạn viết thô như quy ước. Bộ biên dịch sẽ escape khi phát sinh CSS.
|
|
1660
|
-
|
|
1661
|
-
---
|
|
1662
|
-
|
|
1663
|
-
# Bảng tra cứu đầy đủ thuộc tính và giá trị xCSS
|
|
1664
|
-
|
|
1665
|
-
## Cấu trúc dữ liệu
|
|
1666
|
-
|
|
1667
|
-
- **Viết tắt**: Ký hiệu ngắn gọn để sử dụng trong class
|
|
1668
|
-
- **Thuộc tính CSS**: Tên đầy đủ của thuộc tính CSS
|
|
1669
|
-
- **Giá trị viết tắt**: Mapping từ ký hiệu sang giá trị CSS (nếu có)
|
|
1670
|
-
|
|
1671
|
-
---
|
|
1672
|
-
|
|
1673
|
-
## 1. Layout & Display
|
|
1674
|
-
|
|
1675
|
-
### Display
|
|
1676
|
-
|
|
1677
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1678
|
-
| -------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1679
|
-
| `d` | `display` | `b:block`, `ib:inline-block`, `i:inline`, `f:flex`, `if:inline-flex`, `t:table`, `it:inline-table`, `tcp:table-caption`, `tcell:table-cell`, `tcol:table-column`, `tcolg:table-column-group`, `tfg:table-footer-group`, `thg:table-header-group`, `trg:table-row-group`, `tr:table-row`, `fr:flow-root`, `g:grid`, `ig:inline-grid`, `c:contents`, `li:list-item` |
|
|
1680
|
-
|
|
1681
|
-
### Position
|
|
1682
|
-
|
|
1683
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1684
|
-
| -------- | ---------- | -------------------------------------------------------------- |
|
|
1685
|
-
| `pos` | `position` | `s:static`, `f:fixed`, `a:absolute`, `r:relative`, `st:sticky` |
|
|
1686
|
-
|
|
1687
|
-
### Sizing
|
|
1688
|
-
|
|
1689
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1690
|
-
| -------- | ----------------- | ---------------------------------------------------------------- |
|
|
1691
|
-
| `w` | `width` | `mic:min-content`, `mac:max-content`, `fc:fit-content`, `f:100%` |
|
|
1692
|
-
| `h` | `height` | `mic:min-content`, `mac:max-content`, `fc:fit-content` |
|
|
1693
|
-
| `mw` | `max-width` | - |
|
|
1694
|
-
| `mxw` | `max-width` | - |
|
|
1695
|
-
| `mh` | `max-height` | - |
|
|
1696
|
-
| `miw` | `min-width` | `f:100%`, `mic:min-content`, `mac:max-content`, `fc:fit-content` |
|
|
1697
|
-
| `mih` | `min-height` | `f:100%`, `mic:min-content`, `mac:max-content`, `fc:fit-content` |
|
|
1698
|
-
| `blks` | `block-size` | - |
|
|
1699
|
-
| `ins` | `inline-size` | - |
|
|
1700
|
-
| `mbs` | `max-block-size` | - |
|
|
1701
|
-
| `mis` | `max-inline-size` | - |
|
|
1702
|
-
| `mibs` | `min-block-size` | - |
|
|
1703
|
-
| `misz` | `min-inline-size` | - |
|
|
1704
|
-
|
|
1705
|
-
### Positioning
|
|
1706
|
-
|
|
1707
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1708
|
-
| -------- | -------------------- | ---------------- |
|
|
1709
|
-
| `t` | `top` | - |
|
|
1710
|
-
| `r` | `right` | - |
|
|
1711
|
-
| `b` | `bottom` | - |
|
|
1712
|
-
| `l` | `left` | - |
|
|
1713
|
-
| `i` | `inset` | - |
|
|
1714
|
-
| `iblk` | `inset-block` | - |
|
|
1715
|
-
| `ibe` | `inset-block-end` | - |
|
|
1716
|
-
| `ibsta` | `inset-block-start` | - |
|
|
1717
|
-
| `ii` | `inset-inline` | - |
|
|
1718
|
-
| `iie` | `inset-inline-end` | - |
|
|
1719
|
-
| `iis` | `inset-inline-start` | - |
|
|
1720
|
-
|
|
1721
|
-
---
|
|
1722
|
-
|
|
1723
|
-
## 2. Spacing
|
|
1724
|
-
|
|
1725
|
-
### Margin
|
|
1726
|
-
|
|
1727
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1728
|
-
| -------- | --------------------- | ---------------- |
|
|
1729
|
-
| `m` | `margin` | - |
|
|
1730
|
-
| `mt` | `margin-top` | - |
|
|
1731
|
-
| `mr` | `margin-right` | - |
|
|
1732
|
-
| `mb` | `margin-bottom` | - |
|
|
1733
|
-
| `ml` | `margin-left` | - |
|
|
1734
|
-
| `mblk` | `margin-block` | - |
|
|
1735
|
-
| `mbe` | `margin-block-end` | - |
|
|
1736
|
-
| `mbsta` | `margin-block-start` | - |
|
|
1737
|
-
| `min` | `margin-inline` | - |
|
|
1738
|
-
| `mie` | `margin-inline-end` | - |
|
|
1739
|
-
| `mista` | `margin-inline-start` | - |
|
|
1740
|
-
|
|
1741
|
-
### Padding
|
|
1742
|
-
|
|
1743
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1744
|
-
| -------- | ---------------------- | ---------------------------------------------------------- |
|
|
1745
|
-
| `p` | `padding` | - |
|
|
1746
|
-
| `pt` | `padding-top` | - |
|
|
1747
|
-
| `pr` | `padding-right` | - |
|
|
1748
|
-
| `pb` | `padding-bottom` | - |
|
|
1749
|
-
| `pl` | `padding-left` | - |
|
|
1750
|
-
| `pblk` | `padding-block` | - |
|
|
1751
|
-
| `pbe` | `padding-block-end` | - |
|
|
1752
|
-
| `pbs` | `padding-block-start` | - |
|
|
1753
|
-
| `pi` | `padding-inline` | `s:start`, `c:center`, `e:end`, `b:baseline`, `st:stretch` |
|
|
1754
|
-
| `pie` | `padding-inline-end` | - |
|
|
1755
|
-
| `pis` | `padding-inline-start` | - |
|
|
1756
|
-
|
|
1757
|
-
---
|
|
1758
|
-
|
|
1759
|
-
## 3. Colors & Background
|
|
1760
|
-
|
|
1761
|
-
### Color
|
|
1762
|
-
|
|
1763
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1764
|
-
| -------- | ---------- | ---------------------------- |
|
|
1765
|
-
| `c` | `color` | `i:inherit`, `t:transparent` |
|
|
1766
|
-
|
|
1767
|
-
### Background
|
|
1768
|
-
|
|
1769
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1770
|
-
| -------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1771
|
-
| `bg` | `background` | - |
|
|
1772
|
-
| `bgc` | `background-color` | `t:transparent`, `c:currentcolor` |
|
|
1773
|
-
| `bgi` | `background-image` | - |
|
|
1774
|
-
| `bgp` | `background-position` | `t:top`, `b:bottom`, `l:left`, `r:right`, `c:center`, `lt:left top`, `ct:center top`, `rt:right top`, `lc:left center`, `cc:center center`, `rc:right center`, `lb:left bottom`, `cb:center bottom`, `rb:right bottom` |
|
|
1775
|
-
| `bgpx` | `background-position-x` | `l:left`, `r:right`, `c:center` |
|
|
1776
|
-
| `bgpy` | `background-position-y` | `t:top`, `b:bottom`, `c:center` |
|
|
1777
|
-
| `bgr` | `background-repeat` | `r:repeat`, `x:repeat-x`, `y:repeat-y`, `s:space`, `rn:round`, `n:no-repeat`, `rs: repeat space`, `rr:repeat repeat`, `nr:no-repeat round` |
|
|
1778
|
-
| `bgs` | `background-size` | `c:contain` |
|
|
1779
|
-
| `bga` | `background-attachment` | `s:scroll`, `f:fixed`, `l:local` |
|
|
1780
|
-
| `bgbm` | `background-blend-mode` | `n:normal`, `m:multiply`, `s:screen`, `o:overlay`, `d:darken`, `l:lighten`, `cd:color-dodge`, `i:color-burn`, `hl:hard-light`, `sl:soft-light`, `di:difference`, `e:exclusion`, `h:hue`, `sa:saturation`, `c:color`, `lu:luminosity` |
|
|
1781
|
-
| `bgcl` | `background-clip` | `bb:border-box`, `pb:padding-box`, `cb:content-box`, `t:text` |
|
|
1782
|
-
| `bgo` | `background-origin` | `bb:border-box`, `pb:padding-box`, `cb:content-box` |
|
|
1783
|
-
|
|
1784
|
-
---
|
|
1785
|
-
|
|
1786
|
-
## 4. Border
|
|
1787
|
-
|
|
1788
|
-
### Border General
|
|
1789
|
-
|
|
1790
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1791
|
-
| -------- | -------------- | ------------------------------------------------------------------------------------------------- |
|
|
1792
|
-
| `bd` | `border` | `d:dotted`, `ds:dashed`, `db:double`, `g:groove`, `r:ridge`, `i:inset`, `o:outset` |
|
|
1793
|
-
| `bds` | `border-style` | `dt:dotted`, `ds:dashed`, `s:solid`, `db:double`, `g:groove`, `r:ridge`, `in:inset`, `out:outset` |
|
|
1794
|
-
| `bdc` | `border-color` | - |
|
|
1795
|
-
| `bdw` | `border-width` | `t:thin`, `m:medium`, `th:thick` |
|
|
1796
|
-
|
|
1797
|
-
### Border Sides
|
|
1798
|
-
|
|
1799
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1800
|
-
| -------- | --------------- | ---------------- |
|
|
1801
|
-
| `bdt` | `border-top` | - |
|
|
1802
|
-
| `bdr` | `border-right` | - |
|
|
1803
|
-
| `bdb` | `border-bottom` | - |
|
|
1804
|
-
| `bdl` | `border-left` | - |
|
|
1805
|
-
|
|
1806
|
-
### Border Radius
|
|
1807
|
-
|
|
1808
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1809
|
-
| -------- | ---------------------------- | ---------------- |
|
|
1810
|
-
| `bda` | `border-radius` | - |
|
|
1811
|
-
| `bdra` | `border-radius` | - |
|
|
1812
|
-
| `bdtlr` | `border-top-left-radius` | - |
|
|
1813
|
-
| `bdtrr` | `border-top-right-radius` | - |
|
|
1814
|
-
| `bdblr` | `border-bottom-left-radius` | - |
|
|
1815
|
-
| `bdbrr` | `border-bottom-right-radius` | - |
|
|
1816
|
-
| `bdeer` | `border-end-end-radius` | - |
|
|
1817
|
-
| `bdesr` | `border-end-start-radius` | - |
|
|
1818
|
-
| `bdser` | `border-start-end-radius` | - |
|
|
1819
|
-
| `bdssr` | `border-start-start-radius` | - |
|
|
1820
|
-
|
|
1821
|
-
### Border Block/Inline
|
|
1822
|
-
|
|
1823
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1824
|
-
| -------- | --------------------- | ---------------------------------------------------------------------------------- |
|
|
1825
|
-
| `bdblk` | `border-block` | - |
|
|
1826
|
-
| `bdblc` | `border-block-color` | - |
|
|
1827
|
-
| `bdble` | `border-block-end` | - |
|
|
1828
|
-
| `bdbls` | `border-block-start` | - |
|
|
1829
|
-
| `bdblst` | `border-block-style` | `d:dotted`, `ds:dashed`, `db:double`, `g:groove`, `r:ridge`, `i:inset`, `o:outset` |
|
|
1830
|
-
| `bdblwi` | `border-block-width` | - |
|
|
1831
|
-
| `bdi` | `border-inline` | - |
|
|
1832
|
-
| `bdic` | `border-inline-color` | - |
|
|
1833
|
-
| `bdie` | `border-inline-end` | - |
|
|
1834
|
-
| `bdista` | `border-inline-start` | - |
|
|
1835
|
-
| `bdistl` | `border-inline-style` | - |
|
|
1836
|
-
| `bdinw` | `border-inline-width` | - |
|
|
1837
|
-
|
|
1838
|
-
---
|
|
1839
|
-
|
|
1840
|
-
## 5. Typography
|
|
1841
|
-
|
|
1842
|
-
### Font
|
|
1843
|
-
|
|
1844
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1845
|
-
| -------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1846
|
-
| `fn` | `font` | - |
|
|
1847
|
-
| `ff` | `font-family` | `a:ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'`, `s:ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif`, `m:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace` |
|
|
1848
|
-
| `fnf` | `font-family` | - |
|
|
1849
|
-
| `fns` | `font-size` | - |
|
|
1850
|
-
| `fw` | `font-weight` | - |
|
|
1851
|
-
| `fnw` | `font-weight` | - |
|
|
1852
|
-
| `fnsty` | `font-style` | - |
|
|
1853
|
-
| `fnstr` | `font-stretch` | - |
|
|
1854
|
-
| `fnfs` | `font-feature-settings` | - |
|
|
1855
|
-
| `fnk` | `font-kerning` | - |
|
|
1856
|
-
| `fnlo` | `font-language-override` | - |
|
|
1857
|
-
| `fnos` | `font-optical-sizing` | - |
|
|
1858
|
-
| `fnp` | `font-palette` | - |
|
|
1859
|
-
| `fnsa` | `font-size-adjust` | - |
|
|
1860
|
-
| `fnsyn` | `font-synthesis` | - |
|
|
1861
|
-
| `fnsp` | `font-synthesis-position` | - |
|
|
1862
|
-
| `fnssc` | `font-synthesis-small-caps` | - |
|
|
1863
|
-
| `fnss` | `font-synthesis-style` | - |
|
|
1864
|
-
| `fnsw` | `font-synthesis-weight` | - |
|
|
1865
|
-
| `fnv` | `font-variant` | - |
|
|
1866
|
-
| `fnva` | `font-variant-alternates` | - |
|
|
1867
|
-
| `fnvc` | `font-variant-caps` | - |
|
|
1868
|
-
| `fnvea` | `font-variant-east-asian` | - |
|
|
1869
|
-
| `fnve` | `font-variant-emoji` | - |
|
|
1870
|
-
| `fnvl` | `font-variant-ligatures` | - |
|
|
1871
|
-
| `fnvn` | `font-variant-numeric` | - |
|
|
1872
|
-
| `fnvp` | `font-variant-position` | - |
|
|
1873
|
-
| `fnvs` | `font-variation-settings` | - |
|
|
1874
|
-
|
|
1875
|
-
### Text
|
|
1876
|
-
|
|
1877
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1878
|
-
| -------- | --------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
1879
|
-
| `ta` | `text-align` | `s:start`, `e:end`, `l:left`, `r:right`, `c:center`, `j:justify`, `mp:match-parent`, `mc:-moz-center`, `wc:-webkit-center` |
|
|
1880
|
-
| `tal` | `text-align-last` | `s:start`, `e:end`, `l:left`, `r:right`, `c:center`, `j:justify` |
|
|
1881
|
-
| `td` | `text-decoration` | `u:underline` |
|
|
1882
|
-
| `tdc` | `text-decoration-color` | - |
|
|
1883
|
-
| `tdl` | `text-decoration-line` | `u:underline`, `o:overline`, `lt:line-through`, `b:blink` |
|
|
1884
|
-
| `tds` | `text-decoration-style` | `db:double`, `dt:dotted`, `ds:dashed`, `w:wavy` |
|
|
1885
|
-
| `tdt` | `text-decoration-thickness` | `ff:from-font` |
|
|
1886
|
-
| `tdsi` | `text-decoration-skip-ink` | - |
|
|
1887
|
-
| `teph` | `text-emphasis` | - |
|
|
1888
|
-
| `tec` | `text-emphasis-color` | - |
|
|
1889
|
-
| `tep` | `text-emphasis-position` | `or:over right`, `ol:over left`, `ur:under right`, `ul:under left`, `lo:left over`, `ru:right under`, `lu:left under` |
|
|
1890
|
-
| `tes` | `text-emphasis-style` | - |
|
|
1891
|
-
| `ti` | `text-indent` | - |
|
|
1892
|
-
| `tj` | `text-justify` | `iw:inter-word`, `ic:inter-character`, `d:distribute` |
|
|
1893
|
-
| `tor` | `text-orientation` | `m:mixed`, `u:upright`, `sr:sideways-right`, `sl:sideways-left`, `s:sideways`, `ugo:use-glyph-orientation` |
|
|
1894
|
-
| `tol` | `text-overflow` | `c:clip`, `e:ellipsis` |
|
|
1895
|
-
| `trd` | `text-rendering` | `op:optimizeSpeed`, `ol:optimizeLegibility`, `g:geometricPrecision` |
|
|
1896
|
-
| `tsh` | `text-shadow` | - |
|
|
1897
|
-
| `ttr` | `text-transform` | `c:capitalize`, `u:uppercase`, `l:lowercase`, `fw:full-width`, `fsk:full-size-kana` |
|
|
1898
|
-
| `tuo` | `text-underline-offset` | - |
|
|
1899
|
-
| `tup` | `text-underline-position` | `u:under`, `l:left`, `r:right`, `ul:under left`, `ru:right under` |
|
|
1900
|
-
| `tw` | `text-wrap` | `w:wrap`, `n:nowrap`, `b:balance`, `p:pretty` |
|
|
1901
|
-
|
|
1902
|
-
### Line & Spacing
|
|
1903
|
-
|
|
1904
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1905
|
-
| -------- | ---------------- | ---------------- |
|
|
1906
|
-
| `lh` | `line-height` | - |
|
|
1907
|
-
| `lts` | `letter-spacing` | `n:normal` |
|
|
1908
|
-
| `wrs` | `word-spacing` | - |
|
|
1909
|
-
| `lbrk` | `line-break` | - |
|
|
1910
|
-
| `wrb` | `word-break` | - |
|
|
1911
|
-
| `wrtm` | `writing-mode` | - |
|
|
1912
|
-
|
|
1913
|
-
---
|
|
1914
|
-
|
|
1915
|
-
## 6. Flexbox
|
|
1916
|
-
|
|
1917
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1918
|
-
| -------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1919
|
-
| `fx` | `flex` | `i:0 1 auto`, `a:1 1 auto` |
|
|
1920
|
-
| `fxb` | `flex-basis` | - |
|
|
1921
|
-
| `fxd` | `flex-direction` | `r:row`, `rr:row-reverse`, `c:column`, `cr:column-reverse` |
|
|
1922
|
-
| `fxf` | `flex-flow` | - |
|
|
1923
|
-
| `fxg` | `flex-grow` | - |
|
|
1924
|
-
| `fxs` | `flex-shrink` | - |
|
|
1925
|
-
| `fxw` | `flex-wrap` | `w:wrap`, `wr:wrap-reverse`, `n:nowrap` |
|
|
1926
|
-
| `jc` | `justify-content` | `c:center`, `s:start`, `e:end`, `fs:flex-start`, `fe:flex-end`, `l:left`, `r:right`, `n:normal`, `sp:space-between`, `sa:space-around`, `se:space-evenly`, `st:stretch`, `sc:safe center`, `uc:unsafe center` |
|
|
1927
|
-
| `ai` | `align-items` | `n:normal`, `c:center`, `s:start`, `e:end`, `fs:flex-start`, `fe:flex-end`, `ss:self-start`, `se:self-end`, `b:baseline`, `fb:first baseline`, `lb:last baseline`, `sc:safe center`, `uc:unsafe center` |
|
|
1928
|
-
| `as` | `align-self` | `n:normal`, `c:center`, `s:start`, `e:end`, `ss:self-start`, `se:self-end`, `fs:flex-start`, `fe:flex-end`, `b:baseline`, `fb:first baseline`, `lb:last baseline`, `st:stretch`, `sc:safe center`, `uc:unsafe center` |
|
|
1929
|
-
| `ac` | `align-content` | `s:start`, `e:end`, `fs:flex-start`, `fe:flex-end`, `n:normal`, `b:baseline`, `fb:first baseline`, `lb:last baseline`, `sp:space-between`, `sa:space-around`, `se:space-evenly`, `st:stretch`, `sc:safe center`, `uc:unsafe center` |
|
|
1930
|
-
|
|
1931
|
-
---
|
|
1932
|
-
|
|
1933
|
-
## 7. Grid
|
|
1934
|
-
|
|
1935
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1936
|
-
| -------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1937
|
-
| `g` | `grid` | - |
|
|
1938
|
-
| `ga` | `grid-area` | - |
|
|
1939
|
-
| `gc` | `grid-column` | `f:1 / -1` |
|
|
1940
|
-
| `gce` | `grid-column-end` | - |
|
|
1941
|
-
| `gcs` | `grid-column-start` | - |
|
|
1942
|
-
| `gr` | `grid-row` | `f:1 / -1` |
|
|
1943
|
-
| `gre` | `grid-row-end` | - |
|
|
1944
|
-
| `grs` | `grid-row-start` | - |
|
|
1945
|
-
| `gt` | `grid-template` | - |
|
|
1946
|
-
| `gta` | `grid-template-areas` | - |
|
|
1947
|
-
| `gtc` | `grid-template-columns` | `s:subgrid` |
|
|
1948
|
-
| `gtr` | `grid-template-rows` | `s:subgrid` |
|
|
1949
|
-
| `gac` | `grid-auto-columns` | `mic:min-content`, `mac:max-content`, `mm:minmax(0, 1fr)` |
|
|
1950
|
-
| `gar` | `grid-auto-rows` | `mic:min-content`, `mac:max-content`, `mm:minmax(0, 1fr)` |
|
|
1951
|
-
| `gaf` | `grid-auto-flow` | `r:row`, `c:column`, `d:dense`, `rd:row dense`, `cd:column dense` |
|
|
1952
|
-
| `gap` | `gap` | - |
|
|
1953
|
-
| `rgap` | `row-gap` | - |
|
|
1954
|
-
| `colg` | `column-gap` | - |
|
|
1955
|
-
| `ji` | `justify-items` | `n:normal`, `st:stretch`, `c:center`, `s:start`, `e:end`, `fs:flex-start`, `fe:flex-end`, `ss:self-start`, `se:self-end`, `l:left`, `r:right`, `b:baseline`, `fb:first baseline`, `lb:last baseline`, `lr:legacy right`, `ll:legacy left`, `lc:legacy center`, `sc:safe center`, `uc:unsafe center` |
|
|
1956
|
-
| `js` | `justify-self` | `n:normal`, `st:stretch`, `c:center`, `s:start`, `e:end`, `fs:flex-start`, `fe:flex-end`, `ss:self-start`, `se:self-end`, `l:left`, `r:right`, `b:baseline`, `sc:safe center`, `uc:unsafe center` |
|
|
1957
|
-
| `pli` | `place-items` | - |
|
|
1958
|
-
| `pls` | `place-self` | - |
|
|
1959
|
-
| `plc` | `place-content` | - |
|
|
1960
|
-
|
|
1961
|
-
---
|
|
1962
|
-
|
|
1963
|
-
## 8. Effects & Filters
|
|
1964
|
-
|
|
1965
|
-
### Opacity & Visibility
|
|
1966
|
-
|
|
1967
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1968
|
-
| -------- | ------------ | ---------------- |
|
|
1969
|
-
| `opc` | `opacity` | - |
|
|
1970
|
-
| `v` | `visibility` | `c:collapse` |
|
|
1971
|
-
|
|
1972
|
-
### Filter & Backdrop
|
|
1973
|
-
|
|
1974
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1975
|
-
| -------- | ----------------- | ---------------- |
|
|
1976
|
-
| `flt` | `filter` | - |
|
|
1977
|
-
| `bkdf` | `backdrop-filter` | - |
|
|
1978
|
-
|
|
1979
|
-
### Blend Modes
|
|
1980
|
-
|
|
1981
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1982
|
-
| -------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1983
|
-
| `mbd` | `mix-blend-mode` | `n:normal`, `m:multiply`, `s:screen`, `o:overlay`, `d:darken`, `l:lighten`, `cd:color-dodge`, `i:color-burn`, `hl:hard-light`, `sl:soft-light`, `di:difference`, `e:exclusion`, `h:hue`, `sa:saturation`, `c:color`, `lu:luminosity` |
|
|
1984
|
-
|
|
1985
|
-
### Box Shadow
|
|
1986
|
-
|
|
1987
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1988
|
-
| -------- | ------------ | ---------------- |
|
|
1989
|
-
| `bxsh` | `box-shadow` | - |
|
|
1990
|
-
| `bxshd` | `box-shadow` | - |
|
|
1991
|
-
|
|
1992
|
-
---
|
|
1993
|
-
|
|
1994
|
-
## 9. Transforms & Animations
|
|
1995
|
-
|
|
1996
|
-
### Transform
|
|
1997
|
-
|
|
1998
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
1999
|
-
| -------- | ------------------ | ---------------- |
|
|
2000
|
-
| `tra` | `transform` | - |
|
|
2001
|
-
| `trab` | `transform-box` | - |
|
|
2002
|
-
| `trao` | `transform-origin` | - |
|
|
2003
|
-
| `tras` | `transform-style` | - |
|
|
2004
|
-
| `rot` | `rotate` | - |
|
|
2005
|
-
| `s` | `scale` | - |
|
|
2006
|
-
| `trl` | `translate` | - |
|
|
2007
|
-
|
|
2008
|
-
### Transition
|
|
2009
|
-
|
|
2010
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
2011
|
-
| --------- | ---------------------------- | ---------------- |
|
|
2012
|
-
| `tran` | `transition` | - |
|
|
2013
|
-
| `tranb` | `transition-behavior` | - |
|
|
2014
|
-
| `trand` | `transition-delay` | - |
|
|
2015
|
-
| `trandur` | `transition-duration` | - |
|
|
2016
|
-
| `tranp` | `transition-property` | - |
|
|
2017
|
-
| `trantf` | `transition-timing-function` | - |
|
|
2018
|
-
|
|
2019
|
-
### Animation
|
|
2020
|
-
|
|
2021
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
2022
|
-
| -------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
2023
|
-
| `ani` | `animation` | - |
|
|
2024
|
-
| `anic` | `animation-composition` | `r:replace`, `a:add`, `ac:accumulate`, `ra:replace, add`, `aac:add, accumulate`, `raac:replace, add, accumulate` |
|
|
2025
|
-
| `anide` | `animation-delay` | - |
|
|
2026
|
-
| `anidi` | `animation-direction` | `r:reverse`, `a:alternate`, `ar:alternate-reverse`, `nr:normal, reverse`, `arn:alternate, reverse, normal` |
|
|
2027
|
-
| `anidu` | `animation-duration` | - |
|
|
2028
|
-
| `anifm` | `animation-fill-mode` | `f:forwards`, `b:backwards`, `nb:none, backwards`, `fbn:both, forwards, none` |
|
|
2029
|
-
| `aniic` | `animation-iteration-count` | - |
|
|
2030
|
-
| `anin` | `animation-name` | `s:slide` |
|
|
2031
|
-
| `anips` | `animation-play-state` | `p:paused`, `r:running` |
|
|
2032
|
-
| `anitf` | `animation-timing-function` | `ei:ease-in`, `eo:ease-out`, `eio:ease-in-out`, `l:linear`, `ss:step-start`, `se:step-end` |
|
|
2033
|
-
|
|
2034
|
-
---
|
|
2035
|
-
|
|
2036
|
-
## 10. Overflow & Scrolling
|
|
2037
|
-
|
|
2038
|
-
### Overflow
|
|
2039
|
-
|
|
2040
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
2041
|
-
| -------- | ---------------------- | -------------------- |
|
|
2042
|
-
| `ofl` | `overflow` | - |
|
|
2043
|
-
| `oflx` | `overflow-x` | `c:clip`, `s:scroll` |
|
|
2044
|
-
| `ofly` | `overflow-y` | `c:clip`, `s:scroll` |
|
|
2045
|
-
| `oflb` | `overflow-block` | - |
|
|
2046
|
-
| `ofli` | `overflow-inline` | - |
|
|
2047
|
-
| `ofla` | `overflow-anchor` | - |
|
|
2048
|
-
| `oflcm` | `overflow-clip-margin` | - |
|
|
2049
|
-
| `oflw` | `overflow-wrap` | `c:clip`, `s:scroll` |
|
|
2050
|
-
|
|
2051
|
-
### Scroll
|
|
2052
|
-
|
|
2053
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
2054
|
-
| -------- | ----------------------- | ---------------- |
|
|
2055
|
-
| `scrb` | `scroll-behavior` | - |
|
|
2056
|
-
| `scrm` | `scroll-margin` | - |
|
|
2057
|
-
| `scrmb` | `scroll-margin-bottom` | - |
|
|
2058
|
-
| `scrml` | `scroll-margin-left` | - |
|
|
2059
|
-
| `scrmr` | `scroll-margin-right` | - |
|
|
2060
|
-
| `scrmt` | `scroll-margin-top` | - |
|
|
2061
|
-
| `scrp` | `scroll-padding` | - |
|
|
2062
|
-
| `scrpb` | `scroll-padding-bottom` | - |
|
|
2063
|
-
| `scrpl` | `scroll-padding-left` | - |
|
|
2064
|
-
| `scrpr` | `scroll-padding-right` | - |
|
|
2065
|
-
| `scrpt` | `scroll-padding-top` | - |
|
|
2066
|
-
| `scrsa` | `scroll-snap-align` | - |
|
|
2067
|
-
| `scrss` | `scroll-snap-stop` | - |
|
|
2068
|
-
| `scrst` | `scroll-snap-type` | - |
|
|
2069
|
-
| `sbc` | `scrollbar-color` | - |
|
|
2070
|
-
| `sbg` | `scrollbar-gutter` | - |
|
|
2071
|
-
| `sbw` | `scrollbar-width` | - |
|
|
2072
|
-
|
|
2073
|
-
### Overscroll
|
|
2074
|
-
|
|
2075
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
2076
|
-
| -------- | ---------------------------- | ---------------- |
|
|
2077
|
-
| `osrbh` | `overscroll-behavior` | `c:contain` |
|
|
2078
|
-
| `osrbb` | `overscroll-behavior-block` | `c:contain` |
|
|
2079
|
-
| `osrbi` | `overscroll-behavior-inline` | `c:contain` |
|
|
2080
|
-
| `osrbx` | `overscroll-behavior-x` | `c:contain` |
|
|
2081
|
-
| `orsby` | `overscroll-behavior-y` | `c:contain` |
|
|
2082
|
-
|
|
2083
|
-
---
|
|
2084
|
-
|
|
2085
|
-
## 11. Lists & Tables
|
|
2086
|
-
|
|
2087
|
-
### Lists
|
|
2088
|
-
|
|
2089
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
2090
|
-
| -------- | --------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
2091
|
-
| `ls` | `list-style` | `i:inside`, `di:disc`, `c:circle`, `s:square`, `de:decimal`, `g:georgian`, `tci:trad-chinese-informal`, `k:kannada` |
|
|
2092
|
-
| `lsi` | `list-style-image` | - |
|
|
2093
|
-
| `lisp` | `list-style-position` | `i:inside`, `o:outside` |
|
|
2094
|
-
| `lst` | `list-style-type` | `di:disc`, `c:circle`, `s:square`, `de:decimal`, `g:georgian`, `tci:trad-chinese-informal`, `k:kannada` |
|
|
2095
|
-
|
|
2096
|
-
### Tables
|
|
2097
|
-
|
|
2098
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
2099
|
-
| -------- | ----------------- | -------------------------- |
|
|
2100
|
-
| `tbl` | `table-layout` | - |
|
|
2101
|
-
| `bdcl` | `border-collapse` | `s:separate`, `c:collapse` |
|
|
2102
|
-
| `bdsp` | `border-spacing` | - |
|
|
2103
|
-
| `empc` | `empty-cells` | - |
|
|
2104
|
-
| `caps` | `caption-side` | - |
|
|
2105
|
-
|
|
2106
|
-
### Columns
|
|
2107
|
-
|
|
2108
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
2109
|
-
| -------- | ------------------- | ---------------- |
|
|
2110
|
-
| `col` | `columns` | - |
|
|
2111
|
-
| `colc` | `column-count` | - |
|
|
2112
|
-
| `colf` | `column-fill` | - |
|
|
2113
|
-
| `colg` | `column-gap` | - |
|
|
2114
|
-
| `colr` | `column-rule` | - |
|
|
2115
|
-
| `colrc` | `column-rule-color` | - |
|
|
2116
|
-
| `colrs` | `column-rule-style` | - |
|
|
2117
|
-
| `colrw` | `column-rule-width` | - |
|
|
2118
|
-
| `cols` | `column-span` | - |
|
|
2119
|
-
| `colw` | `column-width` | - |
|
|
2120
|
-
|
|
2121
|
-
---
|
|
2122
|
-
|
|
2123
|
-
## 12. Advanced Properties
|
|
2124
|
-
|
|
2125
|
-
### Containment
|
|
2126
|
-
|
|
2127
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
2128
|
-
| -------- | ------------------------------- | ---------------- |
|
|
2129
|
-
| `cnt` | `contain` | - |
|
|
2130
|
-
| `cntibs` | `contain-intrinsic-block-size` | - |
|
|
2131
|
-
| `cntih` | `contain-intrinsic-height` | - |
|
|
2132
|
-
| `cntiis` | `contain-intrinsic-inline-size` | - |
|
|
2133
|
-
| `cntis` | `contain-intrinsic-size` | - |
|
|
2134
|
-
| `ciw` | `contain-intrinsic-width` | - |
|
|
2135
|
-
|
|
2136
|
-
### Container Queries
|
|
2137
|
-
|
|
2138
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
2139
|
-
| -------- | ---------------- | ---------------- |
|
|
2140
|
-
| `ctr` | `container` | - |
|
|
2141
|
-
| `ctrn` | `container-name` | - |
|
|
2142
|
-
| `ctrt` | `container-type` | - |
|
|
2143
|
-
|
|
2144
|
-
### Content & Counters
|
|
2145
|
-
|
|
2146
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
2147
|
-
| -------- | ------------------- | ---------------- |
|
|
2148
|
-
| `ctt` | `content` | - |
|
|
2149
|
-
| `cntri` | `counter-increment` | - |
|
|
2150
|
-
| `cntrr` | `counter-reset` | - |
|
|
2151
|
-
| `cntrs` | `counter-set` | - |
|
|
2152
|
-
|
|
2153
|
-
### Page Breaks
|
|
2154
|
-
|
|
2155
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
2156
|
-
| -------- | ------------------- | ---------------- |
|
|
2157
|
-
| `pg` | `page` | - |
|
|
2158
|
-
| `pgba` | `page-break-after` | - |
|
|
2159
|
-
| `pgbb` | `page-break-before` | - |
|
|
2160
|
-
| `pgbi` | `page-break-inside` | - |
|
|
2161
|
-
| `brka` | `break-after` | - |
|
|
2162
|
-
| `brkb` | `break-before` | - |
|
|
2163
|
-
| `brki` | `break-inside` | - |
|
|
2164
|
-
|
|
2165
|
-
### Other Advanced
|
|
2166
|
-
|
|
2167
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
2168
|
-
| -------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
2169
|
-
| `a` | `all` | - |
|
|
2170
|
-
| `is` | `isolation` | `i:isolate` |
|
|
2171
|
-
| `z` | `z-index` | - |
|
|
2172
|
-
| `ord` | `order` | - |
|
|
2173
|
-
| `fl` | `float` | `is:inline-start`, `ie:inline-end`, `r:right`, `l:left` |
|
|
2174
|
-
| `clr` | `clear` | - |
|
|
2175
|
-
| `rsz` | `resize` | `b:both`, `h:horizontal`, `v:vertical` |
|
|
2176
|
-
| `us` | `user-select` | `t:text`, `all:all`, `c:contain` |
|
|
2177
|
-
| `pe` | `pointer-events` | - |
|
|
2178
|
-
| `cr` | `cursor` | `p:pointer`, `d:default`, `cm:context-menu`, `h:help`, `pg:progress`, `w:wait`, `c:cell`, `t:text`, `vt:vertical-text`, `al:alias`, `cp:copy`, `mo:move`, `nd:no-drop`, `na:not-allowed`, `gr:grab`, `gb:grabbing`, `as:all-scroll`, `colr:col-resize`, `rr:row-resize`, `nr:n-resize`, `er:e-resize`, `sr:s-resize`, `wr:w-resize`, `ner:ne-resize`, `ser:se-resize`, `swr:sw-resize`, `ewr:ew-resize`, `nsr:ns-resize`, `nesw:nesw-resize`, `nwse:nwse-resize`, `zi:zoom-in`, `zo:zoom-out` |
|
|
2179
|
-
| `toa` | `touch-action` | `p:pan-x`, `py:pan-y`, `pm:pan-x pan-y`, `pi:pinch-zoom` |
|
|
2180
|
-
| `zo` | `zoom` | - |
|
|
2181
|
-
|
|
2182
|
-
---
|
|
2183
|
-
|
|
2184
|
-
## 13. WebKit Specific
|
|
2185
|
-
|
|
2186
|
-
| Viết tắt | Thuộc tính | Giá trị viết tắt |
|
|
2187
|
-
| -------- | --------------------------- | --------------------- |
|
|
2188
|
-
| `wlc` | `-webkit-line-clamp` | - |
|
|
2189
|
-
| `wtfc` | `-webkit-text-fill-color` | - |
|
|
2190
|
-
| `wts` | `-webkit-text-stroke` | - |
|
|
2191
|
-
| `wtsc` | `-webkit-text-stroke-color` | - |
|
|
2192
|
-
| `wtsw` | `-webkit-text-stroke-width` | `m:medium`, `t:thick` |
|
|
2193
|
-
|
|
2194
|
-
---
|
|
2195
|
-
|
|
2196
|
-
## 14. Special Values
|
|
2197
|
-
|
|
2198
|
-
### Common Values
|
|
2199
|
-
|
|
2200
|
-
- `n` = `none`
|
|
2201
|
-
- `nm` = `normal`
|
|
2202
|
-
- `a` = `auto`
|
|
2203
|
-
- `i` = `inherit`
|
|
2204
|
-
- `in` = `initial`
|
|
2205
|
-
- `is` = `inline-start`
|
|
2206
|
-
- `ie` = `inline-end`
|
|
2207
|
-
- `tr` = `transparent`
|
|
2208
|
-
- `c` = `center`
|
|
2209
|
-
- `cl` = `collapse`
|
|
2210
|
-
- `l` = `left`
|
|
2211
|
-
- `r` = `right`
|
|
2212
|
-
- `h` = `hidden`
|
|
2213
|
-
- `v` = `visible`
|
|
2214
|
-
- `s` = `start`
|
|
2215
|
-
- `e` = `end`
|
|
2216
|
-
- `t` = `top`
|
|
2217
|
-
- `b` = `bottom`
|
|
2218
|
-
- `bs` = `block-start`
|
|
2219
|
-
- `be` = `block-end`
|
|
2220
|
-
|
|
2221
|
-
### Size Values
|
|
2222
|
-
|
|
2223
|
-
- `t` = `thin`
|
|
2224
|
-
- `m` = `medium`
|
|
2225
|
-
- `th` = `thick`
|
|
2226
|
-
|
|
2227
|
-
### Style Values
|
|
2228
|
-
|
|
2229
|
-
- `s` = `solid`
|
|
2230
|
-
- `d` = `dotted`
|
|
2231
|
-
- `ds` = `dashed`
|
|
2232
|
-
- `db` = `double`
|
|
2233
|
-
- `g` = `groove`
|
|
2234
|
-
- `r` = `ridge`
|
|
2235
|
-
- `i` = `inset`
|
|
2236
|
-
- `o` = `outset`
|
|
2237
|
-
|
|
2238
|
-
---
|
|
2239
|
-
|
|
2240
|
-
_Bảng tra cứu này bao gồm tất cả 409 thuộc tính CSS và giá trị viết tắt được hỗ trợ trong xCSS. Để sử dụng, hãy kết hợp viết tắt thuộc tính với giá trị viết tắt theo cú pháp: `[MQ:][layer]<property><value>[@selector]` (lưu ý: `<property><value>` là bắt buộc)_
|
|
2241
|
-
|
|
2242
|
-
### Example
|
|
2243
|
-
|
|
2244
|
-
```html
|
|
2245
|
-
|
|
2246
|
-
<!DOCTYPE html>
|
|
2247
|
-
<html lang="vi">
|
|
2248
|
-
<head>
|
|
2249
|
-
<meta charset="utf-8">
|
|
2250
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
2251
|
-
<title>Login</title>
|
|
2252
|
-
<meta name="description" content="Mẫu HTML5 cơ bản">
|
|
2253
|
-
<style>
|
|
2254
|
-
:root {
|
|
2255
|
-
--primary-color: #007bff;
|
|
2256
|
-
--secondary-color: #6c757d;
|
|
2257
|
-
--success-color: #28a745;
|
|
2258
|
-
--info-color: #17a2b8;
|
|
2259
|
-
--warning-color: #ffc107;
|
|
2260
|
-
--danger-color: #dc3545;
|
|
2261
|
-
--light-text: #6c757d;
|
|
2262
|
-
--dark-text: #343a40;
|
|
2263
|
-
--body-bg: #f8f9fa;
|
|
2264
|
-
--div-color: #dee2e6;
|
|
2265
|
-
--bd3:1px 1px 1px 1px #dee2e6;
|
|
2266
|
-
--w:#fff;
|
|
2267
|
-
}
|
|
2268
|
-
</style>
|
|
2269
|
-
</head>
|
|
2270
|
-
<body>
|
|
2271
|
-
<div class="dF jcC aiC h100vh bgc--body-bg px10px">
|
|
2272
|
-
<div class="bgc--w p40px bda8px bxshd--bd3 w400px">
|
|
2273
|
-
<h1 class="taC c--dark-text mb30px">Login</h1>
|
|
2274
|
-
<div class="dF fxdC my8px">
|
|
2275
|
-
<input class="p8px" type="text" placeholder="Username">
|
|
2276
|
-
</div>
|
|
2277
|
-
<div class="dF fxdC my8px">
|
|
2278
|
-
<input class="p8px" type="password" placeholder="Password">
|
|
2279
|
-
<a href="#" class="c--primary-color taR mt8px">
|
|
2280
|
-
Forgot password?
|
|
2281
|
-
</a>
|
|
2282
|
-
</div>
|
|
2283
|
-
<div class="taC mt30px">
|
|
2284
|
-
<button class="bdN bgc--primary-color cWhite p12px w100% bdra4px">
|
|
2285
|
-
Login
|
|
2286
|
-
</button>
|
|
2287
|
-
</div>
|
|
2288
|
-
<div class="dF aiC my20px">
|
|
2289
|
-
<div class="fx1 h1px bgc--div"></div>
|
|
2290
|
-
<span class="px10px c--light-text">Or continue with</span>
|
|
2291
|
-
<div class="fx1 h1px bgc--div"></div>
|
|
2292
|
-
</div>
|
|
2293
|
-
<div class="dF jcC">
|
|
2294
|
-
<button class="bdN bgc--info-color c--w p12px mx8px dF aiC bdra4px">
|
|
2295
|
-
<span class="ml8px">Facebook</span>
|
|
2296
|
-
</button>
|
|
2297
|
-
<button class="bdN bgc--success-color c--w p12px mx8px dF aiC bdra4px">
|
|
2298
|
-
|
|
2299
|
-
<span class="ml8px">X-Twitter</span>
|
|
2300
|
-
</button>
|
|
2301
|
-
</div>
|
|
2302
|
-
<div class="dF aiC my20px">
|
|
2303
|
-
<div class="fx1 h1px bgc--div"></div>
|
|
2304
|
-
</div>
|
|
2305
|
-
<div class="taC">
|
|
2306
|
-
<a href="#" class="p12px">
|
|
2307
|
-
Create new account
|
|
2308
|
-
</a>
|
|
2309
|
-
</div>
|
|
2310
|
-
</div>
|
|
2311
|
-
</div>
|
|
2312
|
-
|
|
2313
|
-
<script type="module">
|
|
2314
|
-
import $ from "https://unpkg.com/@fwkui/x-css@1.0.2/index.js";
|
|
2315
|
-
$.cssObserve(document);
|
|
2316
|
-
</script>
|
|
2317
|
-
</body>
|
|
2318
|
-
</html>
|
|
2319
|
-
|
|
2320
|
-
```
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Cac quy tac viet class nhanh
|
|
49
|
+
Dang co ban: `[prefix:][layer][prop][value][@selector]`
|
|
50
|
+
|
|
51
|
+
- `bgc#fff` -> background-color #fff
|
|
52
|
+
- `p10px` -> padding 10px
|
|
53
|
+
- `p!10px` -> padding 10px !important
|
|
54
|
+
- `w--size` -> width: var(--size)
|
|
55
|
+
- `bg{linear-gradient(...)}` -> dung gia tri raw
|
|
56
|
+
- `mx10px` -> margin-left/right 10px
|
|
57
|
+
- `p10&bgc#fff` -> ket hop nhieu cap prop+value
|
|
58
|
+
|
|
59
|
+
## Value ext mac dinh
|
|
60
|
+
```txt
|
|
61
|
+
n:none
|
|
62
|
+
nm:normal
|
|
63
|
+
a:auto
|
|
64
|
+
i:inherit
|
|
65
|
+
in:initial
|
|
66
|
+
is:inline-start
|
|
67
|
+
ie:inline-end
|
|
68
|
+
tr:transparent
|
|
69
|
+
c:center
|
|
70
|
+
cl:collapse
|
|
71
|
+
l:left
|
|
72
|
+
r:right
|
|
73
|
+
h:hidden
|
|
74
|
+
v:visible
|
|
75
|
+
s:start
|
|
76
|
+
e:end
|
|
77
|
+
t:top
|
|
78
|
+
b:bottom
|
|
79
|
+
bs:block-start
|
|
80
|
+
be:block-end
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Cấu hình tuy chinh
|
|
84
|
+
```js
|
|
85
|
+
import { xcss } from "@fwkui/x-css";
|
|
86
|
+
|
|
87
|
+
const { buildCss } = xcss({
|
|
88
|
+
css: [".app{font-family:sans-serif;}", ".box{border-radius:8px;}"],
|
|
89
|
+
gValue: {
|
|
90
|
+
btn: ["padding:8px 12px", "border-radius:6px"],
|
|
91
|
+
},
|
|
92
|
+
exNames: ["no-xcss", "legacy-*"],
|
|
93
|
+
mQuery: [{ tablet: "screen and (min-width: 900px)" }],
|
|
94
|
+
valueExt: { brand: "#0ea5e9" },
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const engine = buildCss(document);
|
|
98
|
+
engine?.observe();
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Tu dien viet tat thuoc tinh (dễ tra cứu)
|
|
102
|
+
Để tài liệu nhẹ và dễ nhìn, **bảng từ điển đầy đủ đã được tách riêng**:
|
|
103
|
+
- Xem tại: `DICTIONARY.md`
|