@pushui/styles 0.0.3
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/dist/index.css +1 -0
- package/dist/index.css.map +1 -0
- package/dist/index.expanded.css +4420 -0
- package/dist/index.expanded.css.map +1 -0
- package/package.json +31 -0
- package/styles/base/layout.scss +73 -0
- package/styles/base/reset.scss +78 -0
- package/styles/index.scss +17 -0
- package/styles/mixins/action.scss +197 -0
- package/styles/mixins/anim.scss +44 -0
- package/styles/mixins/color.scss +12 -0
- package/styles/mixins/form.scss +65 -0
- package/styles/mixins/mq.scss +29 -0
- package/styles/mixins/typo.scss +168 -0
- package/styles/root.scss +96 -0
- package/styles/styles.md +779 -0
- package/styles/utils/align.scss +143 -0
- package/styles/utils/aspect.scss +4 -0
- package/styles/utils/border.scss +48 -0
- package/styles/utils/color.scss +45 -0
- package/styles/utils/display.scss +41 -0
- package/styles/utils/fit.scss +5 -0
- package/styles/utils/font.scss +52 -0
- package/styles/utils/object.scss +9 -0
- package/styles/utils/opacity.scss +5 -0
- package/styles/utils/overflow.scss +7 -0
- package/styles/utils/position.scss +5 -0
- package/styles/utils/radius.scss +13 -0
- package/styles/utils/size.scss +20 -0
- package/styles/utils/spacing.scss +226 -0
package/styles/styles.md
ADDED
|
@@ -0,0 +1,779 @@
|
|
|
1
|
+
# Styles
|
|
2
|
+
|
|
3
|
+
CSS utilities, mixins, and design tokens.
|
|
4
|
+
|
|
5
|
+
## File Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
styles/
|
|
9
|
+
root.scss CSS variables (colors, typography, spacing)
|
|
10
|
+
index.scss Entry point (imports base + utils)
|
|
11
|
+
base/ Global element styles
|
|
12
|
+
reset.scss CSS reset, base elements, heading sizes, .sr-only
|
|
13
|
+
layout.scss Body layout, header padding
|
|
14
|
+
utils/ Utility classes (emitted globally)
|
|
15
|
+
align.scss Flexbox and text alignment
|
|
16
|
+
aspect.scss Aspect ratio utilities
|
|
17
|
+
fit.scss Object-fit utilities
|
|
18
|
+
object.scss Object-position utilities
|
|
19
|
+
border.scss Border utilities
|
|
20
|
+
color.scss Background and text color
|
|
21
|
+
display.scss Display utilities
|
|
22
|
+
font.scss Font size, weight, text transform
|
|
23
|
+
opacity.scss Opacity utilities
|
|
24
|
+
overflow.scss Overflow utilities
|
|
25
|
+
position.scss Position utilities
|
|
26
|
+
radius.scss Border radius utilities
|
|
27
|
+
size.scss Width and height utilities
|
|
28
|
+
spacing.scss Margin, padding, gap (incl. zero + auto)
|
|
29
|
+
mixins/ Consumed via @use in components
|
|
30
|
+
action.scss Button/link mixins
|
|
31
|
+
anim.scss Animation mixins
|
|
32
|
+
color.scss Color variant mixin
|
|
33
|
+
form.scss Form input mixins
|
|
34
|
+
mq.scss Media query mixins
|
|
35
|
+
typo.scss Typography mixins
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## CSS Variables
|
|
41
|
+
|
|
42
|
+
### Colors
|
|
43
|
+
|
|
44
|
+
```css
|
|
45
|
+
/* Base */
|
|
46
|
+
--color-black
|
|
47
|
+
--color-black-50, --color-black-20, --color-black-10
|
|
48
|
+
--color-white
|
|
49
|
+
--color-white-50, --color-white-20, --color-white-10
|
|
50
|
+
|
|
51
|
+
/* Grey scale (1=dark, 7=light) */
|
|
52
|
+
--color-grey-1 /* #333 */
|
|
53
|
+
--color-grey-2 /* #666 */
|
|
54
|
+
--color-grey-3 /* #737373 */
|
|
55
|
+
--color-grey-4 /* #949494 */
|
|
56
|
+
--color-grey-5 /* #DDD */
|
|
57
|
+
--color-grey-6 /* #EEE */
|
|
58
|
+
--color-grey-7 /* #F5F5F5 */
|
|
59
|
+
|
|
60
|
+
/* Color variants: default, primary, secondary, success, danger, warning, info */
|
|
61
|
+
--color-{variant}-1 /* dark (hover, text on light) */
|
|
62
|
+
--color-{variant}-2 /* base (main color) */
|
|
63
|
+
--color-{variant}-3 /* light (background) */
|
|
64
|
+
--color-{variant}-contrast /* vibrant (for dark backgrounds) */
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Typography
|
|
68
|
+
|
|
69
|
+
```css
|
|
70
|
+
/* Font sizes */
|
|
71
|
+
--font-size-1 /* 1rem */
|
|
72
|
+
--font-size-2 /* 1.2rem */
|
|
73
|
+
--font-size-3 /* 1.4rem */
|
|
74
|
+
--font-size-4 /* 1.6rem (base) */
|
|
75
|
+
--font-size-5 /* 1.8rem */
|
|
76
|
+
--font-size-6 /* 2rem */
|
|
77
|
+
--font-size-7 /* 3rem */
|
|
78
|
+
--font-size-8 /* 4rem */
|
|
79
|
+
--font-size-9 /* 6rem */
|
|
80
|
+
|
|
81
|
+
/* Line height */
|
|
82
|
+
--line-height-heading /* 1.2 */
|
|
83
|
+
--line-height-default /* 1.4 */
|
|
84
|
+
|
|
85
|
+
/* Font weight */
|
|
86
|
+
--font-weight-body /* 400 */
|
|
87
|
+
--font-weight-button /* 600 */
|
|
88
|
+
--font-weight-strong /* 600 */
|
|
89
|
+
--font-weight-heading /* 800 */
|
|
90
|
+
|
|
91
|
+
/* Font family */
|
|
92
|
+
--site-font
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Spacing
|
|
96
|
+
|
|
97
|
+
```css
|
|
98
|
+
--spacing-1 /* 0.5rem */
|
|
99
|
+
--spacing-2 /* 1rem */
|
|
100
|
+
--spacing-3 /* 2rem */
|
|
101
|
+
--spacing-4 /* 3rem */
|
|
102
|
+
--spacing-5 /* 4rem */
|
|
103
|
+
--spacing-6 /* 5rem */
|
|
104
|
+
--spacing-7 /* 6rem */
|
|
105
|
+
--spacing-8 /* 8rem */
|
|
106
|
+
--spacing-9 /* 10rem */
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Layout
|
|
110
|
+
|
|
111
|
+
```css
|
|
112
|
+
--screen-max-width /* 168rem */
|
|
113
|
+
--container-max-width /* 120rem */
|
|
114
|
+
--height-mobile-menu /* 6rem */
|
|
115
|
+
--height-main-menu /* 6rem */
|
|
116
|
+
--height-top-menu /* 3rem */
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Body Classes (layout.scss)
|
|
120
|
+
|
|
121
|
+
| Class | Description |
|
|
122
|
+
|-------|-------------|
|
|
123
|
+
| `with-mobile-nav` | Adds mobile header padding-top |
|
|
124
|
+
| `with-main-nav` | Adds main nav padding-top (desktop) |
|
|
125
|
+
| `with-top-nav` | Adds top bar padding-top (desktop) |
|
|
126
|
+
| `header-transparent` | Removes header padding-top for transparent overlay |
|
|
127
|
+
| `freeze` | Locks body scroll |
|
|
128
|
+
|
|
129
|
+
### Border Radius
|
|
130
|
+
|
|
131
|
+
```css
|
|
132
|
+
--radius-1 /* 0.2rem */
|
|
133
|
+
--radius-2 /* 0.4rem */
|
|
134
|
+
--radius-3 /* 0.6rem */
|
|
135
|
+
--radius-4 /* 0.8rem */
|
|
136
|
+
--radius-5 /* 1rem */
|
|
137
|
+
--radius-6 /* 1.5rem */
|
|
138
|
+
--radius-7 /* 2rem */
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Z-Index
|
|
142
|
+
|
|
143
|
+
```css
|
|
144
|
+
--z-index-1 /* 100 */
|
|
145
|
+
--z-index-2 /* 200 */
|
|
146
|
+
--z-index-3 /* 300 */
|
|
147
|
+
--z-index-4 /* 400 */
|
|
148
|
+
--z-index-5 /* 500 */
|
|
149
|
+
--z-index-6 /* 600 */
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Transitions
|
|
153
|
+
|
|
154
|
+
```css
|
|
155
|
+
--transition-default /* 0.2s ease */
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Utility Classes
|
|
161
|
+
|
|
162
|
+
### Spacing
|
|
163
|
+
|
|
164
|
+
Pattern: `{property}{direction?}-{breakpoint?}-{size}`
|
|
165
|
+
|
|
166
|
+
| Property | Description |
|
|
167
|
+
|----------|-------------|
|
|
168
|
+
| `m` | margin |
|
|
169
|
+
| `p` | padding |
|
|
170
|
+
| `g` | gap |
|
|
171
|
+
|
|
172
|
+
| Direction | Description |
|
|
173
|
+
|-----------|-------------|
|
|
174
|
+
| `t` | top |
|
|
175
|
+
| `r` | right |
|
|
176
|
+
| `b` | bottom |
|
|
177
|
+
| `l` | left |
|
|
178
|
+
| `v` | vertical (top + bottom) |
|
|
179
|
+
| `h` | horizontal (left + right) |
|
|
180
|
+
|
|
181
|
+
| Size | Value |
|
|
182
|
+
|------|-------|
|
|
183
|
+
| `0` | 0 |
|
|
184
|
+
| `1` | 0.5rem |
|
|
185
|
+
| `2` | 1rem |
|
|
186
|
+
| `3` | 2rem |
|
|
187
|
+
| `4` | 3rem |
|
|
188
|
+
| `5` | 4rem |
|
|
189
|
+
| `6` | 5rem |
|
|
190
|
+
| `7` | 6rem |
|
|
191
|
+
| `8` | 8rem |
|
|
192
|
+
| `9` | 10rem |
|
|
193
|
+
|
|
194
|
+
| Special | Description |
|
|
195
|
+
|---------|-------------|
|
|
196
|
+
| `m-auto` | margin: auto |
|
|
197
|
+
| `mh-auto` | margin left + right: auto (centering) |
|
|
198
|
+
| `mv-auto` | margin top + bottom: auto |
|
|
199
|
+
| `mt-auto`, `mr-auto`, `mb-auto`, `ml-auto` | directional auto |
|
|
200
|
+
|
|
201
|
+
| Breakpoint | Width |
|
|
202
|
+
|------------|-------|
|
|
203
|
+
| `sm` | ≥768px |
|
|
204
|
+
| `md` | ≥1024px |
|
|
205
|
+
| `lg` | ≥1200px |
|
|
206
|
+
| `xl` | ≥1400px |
|
|
207
|
+
|
|
208
|
+
```html
|
|
209
|
+
<!-- Base -->
|
|
210
|
+
<div class="m-3">margin all sides</div>
|
|
211
|
+
<div class="mt-2">margin top</div>
|
|
212
|
+
<div class="pv-4">padding vertical</div>
|
|
213
|
+
<div class="ph-3">padding horizontal</div>
|
|
214
|
+
<div class="g-2">gap</div>
|
|
215
|
+
|
|
216
|
+
<!-- Zero -->
|
|
217
|
+
<div class="m-0">no margin</div>
|
|
218
|
+
<div class="p-0">no padding</div>
|
|
219
|
+
<div class="mt-0">no margin top</div>
|
|
220
|
+
|
|
221
|
+
<!-- Auto -->
|
|
222
|
+
<div class="mh-auto">centered block</div>
|
|
223
|
+
<div class="ml-auto">push right</div>
|
|
224
|
+
|
|
225
|
+
<!-- Responsive -->
|
|
226
|
+
<div class="p-2 p-md-4 p-lg-5">responsive padding</div>
|
|
227
|
+
<div class="mt-2 mt-lg-4">responsive margin top</div>
|
|
228
|
+
<div class="g-2 g-md-3">responsive gap</div>
|
|
229
|
+
<div class="m-2 m-md-0">margin on mobile, none on desktop</div>
|
|
230
|
+
<div class="mh-auto mh-md-0">centered on mobile, reset on desktop</div>
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Display
|
|
234
|
+
|
|
235
|
+
Pattern: `d-{breakpoint?}-{value}`
|
|
236
|
+
|
|
237
|
+
| Class | Value |
|
|
238
|
+
|-------|-------|
|
|
239
|
+
| `d-none` | none |
|
|
240
|
+
| `d-block` | block |
|
|
241
|
+
| `d-flex` | flex |
|
|
242
|
+
| `d-grid` | grid |
|
|
243
|
+
| `d-inline` | inline |
|
|
244
|
+
| `d-inline-block` | inline-block |
|
|
245
|
+
| `d-inline-flex` | inline-flex |
|
|
246
|
+
|
|
247
|
+
All values support responsive breakpoints (sm, md, lg, xl).
|
|
248
|
+
|
|
249
|
+
```html
|
|
250
|
+
<!-- Hide/show -->
|
|
251
|
+
<div class="d-none d-md-block">hidden on mobile, visible on desktop</div>
|
|
252
|
+
<div class="d-block d-lg-none">visible on mobile, hidden on large</div>
|
|
253
|
+
|
|
254
|
+
<!-- Responsive flex -->
|
|
255
|
+
<div class="d-none d-md-flex">flex on desktop only</div>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Font Size
|
|
259
|
+
|
|
260
|
+
Pattern: `fs-{breakpoint?}-{size}`
|
|
261
|
+
|
|
262
|
+
| Size | Value |
|
|
263
|
+
|------|-------|
|
|
264
|
+
| `1` | 1rem |
|
|
265
|
+
| `2` | 1.2rem |
|
|
266
|
+
| `3` | 1.4rem |
|
|
267
|
+
| `4` | 1.6rem (base) |
|
|
268
|
+
| `5` | 1.8rem |
|
|
269
|
+
| `6` | 2rem |
|
|
270
|
+
| `7` | 3rem |
|
|
271
|
+
| `8` | 4rem |
|
|
272
|
+
| `9` | 6rem |
|
|
273
|
+
|
|
274
|
+
**Default heading sizes** (applied globally to h1-h6 tags):
|
|
275
|
+
|
|
276
|
+
| Tag | Size |
|
|
277
|
+
|-----|------|
|
|
278
|
+
| `h1` | fs-8 (4rem) |
|
|
279
|
+
| `h2` | fs-7 (3rem) |
|
|
280
|
+
| `h3` | fs-6 (2rem) |
|
|
281
|
+
| `h4` | fs-5 (1.8rem) |
|
|
282
|
+
| `h5` | fs-4 (1.6rem) |
|
|
283
|
+
| `h6` | fs-3 (1.4rem) |
|
|
284
|
+
|
|
285
|
+
```html
|
|
286
|
+
<!-- Base -->
|
|
287
|
+
<h2 class="fs-8">Large heading</h2>
|
|
288
|
+
<p class="fs-5">Larger text</p>
|
|
289
|
+
|
|
290
|
+
<!-- Responsive -->
|
|
291
|
+
<h1 class="fs-6 fs-md-8 fs-lg-9">Small on mobile, huge on desktop</h1>
|
|
292
|
+
|
|
293
|
+
<!-- SEO vs visual: h2 tag for SEO, fs-8 for h1 visual size -->
|
|
294
|
+
<h2 class="fs-8">Looks like h1, semantically h2</h2>
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Font Weight
|
|
298
|
+
|
|
299
|
+
| Class | Value |
|
|
300
|
+
|-------|-------|
|
|
301
|
+
| `fw-body` | 400 |
|
|
302
|
+
| `fw-button` | 600 |
|
|
303
|
+
| `fw-strong` | 600 |
|
|
304
|
+
| `fw-heading` | 800 |
|
|
305
|
+
|
|
306
|
+
```html
|
|
307
|
+
<p class="fw-strong">Bold text</p>
|
|
308
|
+
<span class="fw-heading">Extra bold</span>
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Text Transform
|
|
312
|
+
|
|
313
|
+
| Class | Property |
|
|
314
|
+
|-------|----------|
|
|
315
|
+
| `text-uppercase` | text-transform: uppercase |
|
|
316
|
+
| `text-lowercase` | text-transform: lowercase |
|
|
317
|
+
| `text-capitalize` | text-transform: capitalize |
|
|
318
|
+
| `text-nowrap` | white-space: nowrap |
|
|
319
|
+
| `text-truncate` | overflow: hidden + text-overflow: ellipsis + nowrap |
|
|
320
|
+
|
|
321
|
+
```html
|
|
322
|
+
<span class="text-uppercase">uppercased</span>
|
|
323
|
+
<p class="text-truncate">Long text that gets cut off with ellipsis...</p>
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### Alignment
|
|
327
|
+
|
|
328
|
+
Pattern: `{property}-{breakpoint?}-{value}`
|
|
329
|
+
|
|
330
|
+
#### Text Align
|
|
331
|
+
|
|
332
|
+
```html
|
|
333
|
+
<p class="text-left">Left aligned</p>
|
|
334
|
+
<p class="text-center">Centered</p>
|
|
335
|
+
<p class="text-right">Right aligned</p>
|
|
336
|
+
|
|
337
|
+
<!-- Responsive -->
|
|
338
|
+
<p class="text-center text-md-left">Center on mobile, left on desktop</p>
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
#### Flexbox
|
|
342
|
+
|
|
343
|
+
```html
|
|
344
|
+
<!-- Direction -->
|
|
345
|
+
<div class="flex-row">row</div>
|
|
346
|
+
<div class="flex-col">column</div>
|
|
347
|
+
<div class="flex-row-reverse">row reverse</div>
|
|
348
|
+
<div class="flex-col-reverse">column reverse</div>
|
|
349
|
+
|
|
350
|
+
<!-- Responsive direction -->
|
|
351
|
+
<div class="flex-col flex-md-row">column on mobile, row on desktop</div>
|
|
352
|
+
|
|
353
|
+
<!-- Justify content -->
|
|
354
|
+
<div class="justify-start">flex-start</div>
|
|
355
|
+
<div class="justify-center">center</div>
|
|
356
|
+
<div class="justify-end">flex-end</div>
|
|
357
|
+
<div class="justify-between">space-between</div>
|
|
358
|
+
<div class="justify-around">space-around</div>
|
|
359
|
+
<div class="justify-evenly">space-evenly</div>
|
|
360
|
+
|
|
361
|
+
<!-- Responsive justify -->
|
|
362
|
+
<div class="justify-center justify-md-between">center on mobile, between on desktop</div>
|
|
363
|
+
|
|
364
|
+
<!-- Align items -->
|
|
365
|
+
<div class="items-start">flex-start</div>
|
|
366
|
+
<div class="items-center">center</div>
|
|
367
|
+
<div class="items-end">flex-end</div>
|
|
368
|
+
<div class="items-stretch">stretch</div>
|
|
369
|
+
<div class="items-baseline">baseline</div>
|
|
370
|
+
|
|
371
|
+
<!-- Responsive items -->
|
|
372
|
+
<div class="items-center items-md-start">center on mobile, start on desktop</div>
|
|
373
|
+
|
|
374
|
+
<!-- Align self -->
|
|
375
|
+
<div class="self-start">flex-start</div>
|
|
376
|
+
<div class="self-center">center</div>
|
|
377
|
+
<div class="self-end">flex-end</div>
|
|
378
|
+
|
|
379
|
+
<!-- Responsive self -->
|
|
380
|
+
<div class="self-center self-lg-end">center on mobile, end on large</div>
|
|
381
|
+
|
|
382
|
+
<!-- Wrap -->
|
|
383
|
+
<div class="flex-wrap">wrap</div>
|
|
384
|
+
<div class="flex-nowrap">nowrap</div>
|
|
385
|
+
|
|
386
|
+
<!-- Responsive wrap -->
|
|
387
|
+
<div class="flex-wrap flex-md-nowrap">wrap on mobile, nowrap on desktop</div>
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
### Colors
|
|
391
|
+
|
|
392
|
+
#### Background
|
|
393
|
+
|
|
394
|
+
```html
|
|
395
|
+
<!-- Variants -->
|
|
396
|
+
<div class="bg-primary-1">dark primary</div>
|
|
397
|
+
<div class="bg-primary-2">base primary</div>
|
|
398
|
+
<div class="bg-primary-3">light primary</div>
|
|
399
|
+
<div class="bg-primary-contrast">contrast primary</div>
|
|
400
|
+
|
|
401
|
+
<!-- Grey -->
|
|
402
|
+
<div class="bg-grey-1">dark grey</div>
|
|
403
|
+
<div class="bg-grey-7">light grey</div>
|
|
404
|
+
|
|
405
|
+
<!-- Black/White -->
|
|
406
|
+
<div class="bg-black">black</div>
|
|
407
|
+
<div class="bg-white">white</div>
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
#### Text
|
|
411
|
+
|
|
412
|
+
```html
|
|
413
|
+
<!-- Variants -->
|
|
414
|
+
<p class="text-primary-1">dark primary</p>
|
|
415
|
+
<p class="text-primary-2">base primary</p>
|
|
416
|
+
<p class="text-danger-2">danger</p>
|
|
417
|
+
<p class="text-success-2">success</p>
|
|
418
|
+
|
|
419
|
+
<!-- Grey -->
|
|
420
|
+
<p class="text-grey-2">muted text</p>
|
|
421
|
+
|
|
422
|
+
<!-- Black/White -->
|
|
423
|
+
<p class="text-black">black</p>
|
|
424
|
+
<p class="text-white">white</p>
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
### Border
|
|
428
|
+
|
|
429
|
+
| Class | Description |
|
|
430
|
+
|-------|-------------|
|
|
431
|
+
| `b` | border all sides (grey-4) |
|
|
432
|
+
| `b-t`, `b-r`, `b-b`, `b-l` | directional border (grey-4) |
|
|
433
|
+
| `b-none` | remove border |
|
|
434
|
+
| `b-{variant}-{level}` | colored border (e.g. `b-primary-2`) |
|
|
435
|
+
| `b-grey-{1-7}` | grey border |
|
|
436
|
+
| `b-black`, `b-white` | black/white border |
|
|
437
|
+
|
|
438
|
+
### Border Radius
|
|
439
|
+
|
|
440
|
+
| Class | Value |
|
|
441
|
+
|-------|-------|
|
|
442
|
+
| `r-1` through `r-7` | `--radius-1` through `--radius-7` |
|
|
443
|
+
| `r-full` | 9999px (circle) |
|
|
444
|
+
| `r-none` | 0 |
|
|
445
|
+
|
|
446
|
+
### Overflow
|
|
447
|
+
|
|
448
|
+
| Class | Property |
|
|
449
|
+
|-------|----------|
|
|
450
|
+
| `overflow-hidden` | overflow: hidden |
|
|
451
|
+
| `overflow-auto` | overflow: auto |
|
|
452
|
+
| `overflow-scroll` | overflow: scroll |
|
|
453
|
+
| `overflow-x-auto` | overflow-x: auto |
|
|
454
|
+
| `overflow-x-hidden` | overflow-x: hidden |
|
|
455
|
+
| `overflow-y-auto` | overflow-y: auto |
|
|
456
|
+
| `overflow-y-hidden` | overflow-y: hidden |
|
|
457
|
+
|
|
458
|
+
### Size
|
|
459
|
+
|
|
460
|
+
| Class | Property |
|
|
461
|
+
|-------|----------|
|
|
462
|
+
| `w-full` | width: 100% |
|
|
463
|
+
| `w-auto` | width: auto |
|
|
464
|
+
| `h-full` | height: 100% |
|
|
465
|
+
| `h-auto` | height: auto |
|
|
466
|
+
| `h-screen` | height: 100vh (100dvh where supported) |
|
|
467
|
+
| `min-h-screen` | min-height: 100vh (100dvh where supported) |
|
|
468
|
+
|
|
469
|
+
### Position
|
|
470
|
+
|
|
471
|
+
| Class | Property |
|
|
472
|
+
|-------|----------|
|
|
473
|
+
| `relative` | position: relative |
|
|
474
|
+
| `absolute` | position: absolute |
|
|
475
|
+
| `fixed` | position: fixed |
|
|
476
|
+
| `sticky` | position: sticky |
|
|
477
|
+
| `static` | position: static |
|
|
478
|
+
|
|
479
|
+
### Opacity
|
|
480
|
+
|
|
481
|
+
Pattern: `opacity-{0-10}`
|
|
482
|
+
|
|
483
|
+
| Class | Value |
|
|
484
|
+
|-------|-------|
|
|
485
|
+
| `opacity-0` | 0 |
|
|
486
|
+
| `opacity-1` | 0.1 |
|
|
487
|
+
| `opacity-2` | 0.2 |
|
|
488
|
+
| ... | ... |
|
|
489
|
+
| `opacity-5` | 0.5 |
|
|
490
|
+
| ... | ... |
|
|
491
|
+
| `opacity-10` | 1 |
|
|
492
|
+
|
|
493
|
+
### Aspect Ratio
|
|
494
|
+
|
|
495
|
+
| Class | Value |
|
|
496
|
+
|-------|-------|
|
|
497
|
+
| `aspect-square` | 1 / 1 |
|
|
498
|
+
| `aspect-video` | 16 / 9 |
|
|
499
|
+
| `aspect-4-3` | 4 / 3 |
|
|
500
|
+
| `aspect-3-2` | 3 / 2 |
|
|
501
|
+
|
|
502
|
+
### Object Fit
|
|
503
|
+
|
|
504
|
+
| Class | Property |
|
|
505
|
+
|-------|----------|
|
|
506
|
+
| `fit-cover` | object-fit: cover |
|
|
507
|
+
| `fit-contain` | object-fit: contain |
|
|
508
|
+
| `fit-fill` | object-fit: fill |
|
|
509
|
+
| `fit-none` | object-fit: none |
|
|
510
|
+
| `fit-scale-down` | object-fit: scale-down |
|
|
511
|
+
|
|
512
|
+
### Object Position
|
|
513
|
+
|
|
514
|
+
| Class | Property |
|
|
515
|
+
|-------|----------|
|
|
516
|
+
| `obj-center` | object-position: center |
|
|
517
|
+
| `obj-top` | object-position: top |
|
|
518
|
+
| `obj-bottom` | object-position: bottom |
|
|
519
|
+
| `obj-left` | object-position: left |
|
|
520
|
+
| `obj-right` | object-position: right |
|
|
521
|
+
| `obj-top-left` | object-position: top left |
|
|
522
|
+
| `obj-top-right` | object-position: top right |
|
|
523
|
+
| `obj-bottom-left` | object-position: bottom left |
|
|
524
|
+
| `obj-bottom-right` | object-position: bottom right |
|
|
525
|
+
|
|
526
|
+
### Accessibility
|
|
527
|
+
|
|
528
|
+
| Class | Description |
|
|
529
|
+
|-------|-------------|
|
|
530
|
+
| `sr-only` | Visually hidden, accessible to screen readers |
|
|
531
|
+
|
|
532
|
+
```html
|
|
533
|
+
<button>
|
|
534
|
+
<svg>...</svg>
|
|
535
|
+
<span class="sr-only">Close menu</span>
|
|
536
|
+
</button>
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
---
|
|
540
|
+
|
|
541
|
+
## Mixins
|
|
542
|
+
|
|
543
|
+
Import mixins in SCSS modules:
|
|
544
|
+
|
|
545
|
+
```scss
|
|
546
|
+
@use 'styles/mixins/mq' as *;
|
|
547
|
+
@use 'styles/mixins/typo' as *;
|
|
548
|
+
@use 'styles/mixins/form' as *;
|
|
549
|
+
@use 'styles/mixins/action' as *;
|
|
550
|
+
@use 'styles/mixins/anim' as *;
|
|
551
|
+
@use 'styles/mixins/color' as *;
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
### Media Queries
|
|
555
|
+
|
|
556
|
+
```scss
|
|
557
|
+
@use 'styles/mixins/mq' as *;
|
|
558
|
+
|
|
559
|
+
.component {
|
|
560
|
+
padding: 1rem;
|
|
561
|
+
|
|
562
|
+
@include mq-xs { /* ≥480px */ }
|
|
563
|
+
@include mq-sm { /* ≥768px */ }
|
|
564
|
+
@include mq-md { /* ≥1024px */ }
|
|
565
|
+
@include mq-lg { /* ≥1200px */ }
|
|
566
|
+
@include mq-xl { /* ≥1400px */ }
|
|
567
|
+
}
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
### Typography
|
|
571
|
+
|
|
572
|
+
```scss
|
|
573
|
+
@use 'styles/mixins/typo' as *;
|
|
574
|
+
|
|
575
|
+
.heading {
|
|
576
|
+
@include base-heading;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.link {
|
|
580
|
+
@include base-link;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.paragraph {
|
|
584
|
+
@include base-paragraph;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
.code-block {
|
|
588
|
+
@include base-code-block;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
.code-inline {
|
|
592
|
+
@include base-code-inline;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
.keyboard {
|
|
596
|
+
@include base-keyboard;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.note {
|
|
600
|
+
@include base-note;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.blockquote {
|
|
604
|
+
@include base-blockquote;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
.caption {
|
|
608
|
+
@include base-caption;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.table {
|
|
612
|
+
@include base-table;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
.hr {
|
|
616
|
+
@include base-hr;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
.mark {
|
|
620
|
+
@include base-mark;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.rich-text {
|
|
624
|
+
@include base-list;
|
|
625
|
+
}
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
### Form
|
|
629
|
+
|
|
630
|
+
```scss
|
|
631
|
+
@use 'styles/mixins/form' as *;
|
|
632
|
+
|
|
633
|
+
.field {
|
|
634
|
+
@include form-wrapper;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
.label {
|
|
638
|
+
@include form-label;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.input {
|
|
642
|
+
@include form-input;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
.disabled {
|
|
646
|
+
@include form-disabled;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
.spinner {
|
|
650
|
+
@include form-spinner;
|
|
651
|
+
}
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
### Action (Button/Link)
|
|
655
|
+
|
|
656
|
+
```scss
|
|
657
|
+
@use 'styles/mixins/action' as *;
|
|
658
|
+
|
|
659
|
+
.button {
|
|
660
|
+
@include action-base;
|
|
661
|
+
@include action-appearances;
|
|
662
|
+
@include action-variants;
|
|
663
|
+
@include action-disabled;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
.close-button {
|
|
667
|
+
@include action-close;
|
|
668
|
+
}
|
|
669
|
+
```
|
|
670
|
+
|
|
671
|
+
### Animation
|
|
672
|
+
|
|
673
|
+
```scss
|
|
674
|
+
@use 'styles/mixins/anim' as *;
|
|
675
|
+
|
|
676
|
+
.fade {
|
|
677
|
+
@include anim-fade;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
.scale {
|
|
681
|
+
@include anim-scale;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.slide-up {
|
|
685
|
+
@include anim-slide-up;
|
|
686
|
+
}
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
Animation classes use `.active` and `.removing` states:
|
|
690
|
+
|
|
691
|
+
```html
|
|
692
|
+
<div class="fade">hidden</div>
|
|
693
|
+
<div class="fade active">visible</div>
|
|
694
|
+
<div class="fade removing">fading out</div>
|
|
695
|
+
```
|
|
696
|
+
|
|
697
|
+
### Color Variants
|
|
698
|
+
|
|
699
|
+
```scss
|
|
700
|
+
@use 'styles/mixins/color' as *;
|
|
701
|
+
|
|
702
|
+
.alert {
|
|
703
|
+
@include color-variants('variant-');
|
|
704
|
+
}
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
Generates classes for all variants:
|
|
708
|
+
- `.variant-default`
|
|
709
|
+
- `.variant-primary`
|
|
710
|
+
- `.variant-secondary`
|
|
711
|
+
- `.variant-success`
|
|
712
|
+
- `.variant-danger`
|
|
713
|
+
- `.variant-warning`
|
|
714
|
+
- `.variant-info`
|
|
715
|
+
|
|
716
|
+
---
|
|
717
|
+
|
|
718
|
+
## Common Patterns
|
|
719
|
+
|
|
720
|
+
### Responsive Layout
|
|
721
|
+
|
|
722
|
+
```html
|
|
723
|
+
<div class="d-flex flex-col flex-md-row g-3 g-lg-4">
|
|
724
|
+
<div class="p-3 p-md-4">Sidebar</div>
|
|
725
|
+
<div class="p-3 p-md-4">Content</div>
|
|
726
|
+
</div>
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
### Centered Card
|
|
730
|
+
|
|
731
|
+
```html
|
|
732
|
+
<div class="d-flex justify-center items-center p-4">
|
|
733
|
+
<div class="bg-white p-4 r-3">Card content</div>
|
|
734
|
+
</div>
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
### Section Spacing
|
|
738
|
+
|
|
739
|
+
```html
|
|
740
|
+
<section class="pv-4 pv-lg-5">
|
|
741
|
+
<div class="text-center mb-4">
|
|
742
|
+
<h2>Section Title</h2>
|
|
743
|
+
</div>
|
|
744
|
+
<div class="g-3">Content</div>
|
|
745
|
+
</section>
|
|
746
|
+
```
|
|
747
|
+
|
|
748
|
+
### Status Colors
|
|
749
|
+
|
|
750
|
+
```html
|
|
751
|
+
<span class="text-success-2">Success message</span>
|
|
752
|
+
<span class="text-danger-2">Error message</span>
|
|
753
|
+
<span class="text-warning-2">Warning message</span>
|
|
754
|
+
<div class="bg-info-3 p-3">Info box</div>
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
### Hide on Mobile
|
|
758
|
+
|
|
759
|
+
```html
|
|
760
|
+
<nav class="d-none d-md-flex g-2">Desktop nav</nav>
|
|
761
|
+
<button class="d-block d-md-none">Mobile menu</button>
|
|
762
|
+
```
|
|
763
|
+
|
|
764
|
+
### Truncated Text
|
|
765
|
+
|
|
766
|
+
```html
|
|
767
|
+
<p class="text-truncate" style="max-width: 200px">
|
|
768
|
+
Very long text that will be cut off with an ellipsis
|
|
769
|
+
</p>
|
|
770
|
+
```
|
|
771
|
+
|
|
772
|
+
### Accessible Icon Button
|
|
773
|
+
|
|
774
|
+
```html
|
|
775
|
+
<button>
|
|
776
|
+
<svg>...</svg>
|
|
777
|
+
<span class="sr-only">Delete item</span>
|
|
778
|
+
</button>
|
|
779
|
+
```
|