@tedi-design-system/core 3.1.0 → 3.3.0
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/README.md +2 -0
- package/docs/css-utilities.md +444 -0
- package/index.css +1 -1
- package/package.json +9 -9
- package/variables/_dimensional-variables.scss +34 -37
- package/variables/themes/default/font-variables__default.scss +8 -6
- package/variables/themes/muis/font-variables__muis.scss +4 -3
- package/variables/themes/rit/font-variables__rit.scss +4 -3
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
Usage instructions and detailed documentation can be found in the [TEDI Design System wiki](https://github.com/TEDI-Design-System/general).
|
|
8
8
|
|
|
9
|
+
For a full reference of available utility CSS classes and SCSS mixins, see [CSS Utilities Documentation](docs/css-utilities.md).
|
|
10
|
+
|
|
9
11
|
---
|
|
10
12
|
|
|
11
13
|
## Contributing
|
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
# CSS Utility Classes & SCSS Mixins
|
|
2
|
+
|
|
3
|
+
A comprehensive reference of all available utility/helper CSS classes and SCSS mixins in `@tedi-design-system/core`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Display & Visibility](#display--visibility)
|
|
10
|
+
- [Flexbox](#flexbox)
|
|
11
|
+
- [Grid System](#grid-system)
|
|
12
|
+
- [Typography](#typography)
|
|
13
|
+
- [Headings](#headings)
|
|
14
|
+
- [Body Text Sizes](#body-text-sizes)
|
|
15
|
+
- [Text Colors](#text-colors)
|
|
16
|
+
- [Text Transform](#text-transform)
|
|
17
|
+
- [Text Wrapping & Whitespace](#text-wrapping--whitespace)
|
|
18
|
+
- [Text Weight & Style](#text-weight--style)
|
|
19
|
+
- [Text Alignment](#text-alignment)
|
|
20
|
+
- [Text Line Height](#text-line-height)
|
|
21
|
+
- [Icons](#icons)
|
|
22
|
+
- [Links](#links)
|
|
23
|
+
- [Print Utilities](#print-utilities)
|
|
24
|
+
- [SCSS Mixins](#scss-mixins)
|
|
25
|
+
- [General Mixins](#general-mixins)
|
|
26
|
+
- [Breakpoint Mixins](#breakpoint-mixins)
|
|
27
|
+
- [Typography Mixins](#typography-mixins)
|
|
28
|
+
- [Breakpoints Reference](#breakpoints-reference)
|
|
29
|
+
- [Spacing Scale Reference](#spacing-scale-reference)
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Display & Visibility
|
|
34
|
+
|
|
35
|
+
| Class | Effect |
|
|
36
|
+
|-------|--------|
|
|
37
|
+
| `.hidden`, `[hidden]` | `display: none !important` |
|
|
38
|
+
| `.block` | `display: block !important` |
|
|
39
|
+
| `.inline-block` | `display: inline-block !important` |
|
|
40
|
+
| `.flex` | `display: flex !important` |
|
|
41
|
+
| `.sr-only` | Visually hidden but accessible to screen readers |
|
|
42
|
+
| `.sr-only.focusable` | Becomes visible on `:focus` / `:active` (keyboard navigation) |
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Flexbox
|
|
47
|
+
|
|
48
|
+
> All flexbox utilities are **responsive** — append `-sm`, `-md`, `-lg`, `-xl`, or `-xxl` for breakpoint-specific behavior (e.g. `.flex-md-row`, `.justify-lg-center`).
|
|
49
|
+
|
|
50
|
+
### Flex Direction
|
|
51
|
+
|
|
52
|
+
| Class | Value |
|
|
53
|
+
|-------|-------|
|
|
54
|
+
| `.flex-row` | `flex-direction: row` |
|
|
55
|
+
| `.flex-column` | `flex-direction: column` |
|
|
56
|
+
| `.flex-row-reverse` | `flex-direction: row-reverse` |
|
|
57
|
+
| `.flex-column-reverse` | `flex-direction: column-reverse` |
|
|
58
|
+
|
|
59
|
+
### Flex Fill, Grow & Shrink
|
|
60
|
+
|
|
61
|
+
| Class | Value |
|
|
62
|
+
|-------|-------|
|
|
63
|
+
| `.flex-fill` | `flex: 1 1 auto` |
|
|
64
|
+
| `.flex-grow-0` | `flex-grow: 0` |
|
|
65
|
+
| `.flex-grow-1` | `flex-grow: 1` |
|
|
66
|
+
| `.flex-shrink-0` | `flex-shrink: 0` |
|
|
67
|
+
| `.flex-shrink-1` | `flex-shrink: 1` |
|
|
68
|
+
|
|
69
|
+
### Flex Wrap
|
|
70
|
+
|
|
71
|
+
| Class | Value |
|
|
72
|
+
|-------|-------|
|
|
73
|
+
| `.flex-wrap` | `flex-wrap: wrap` |
|
|
74
|
+
| `.flex-nowrap` | `flex-wrap: nowrap` |
|
|
75
|
+
| `.flex-wrap-reverse` | `flex-wrap: wrap-reverse` |
|
|
76
|
+
|
|
77
|
+
### Justify Content
|
|
78
|
+
|
|
79
|
+
| Class | Value |
|
|
80
|
+
|-------|-------|
|
|
81
|
+
| `.justify-start` | `justify-content: flex-start` |
|
|
82
|
+
| `.justify-end` | `justify-content: flex-end` |
|
|
83
|
+
| `.justify-center` | `justify-content: center` |
|
|
84
|
+
| `.justify-between` | `justify-content: space-between` |
|
|
85
|
+
| `.justify-around` | `justify-content: space-around` |
|
|
86
|
+
| `.justify-evenly` | `justify-content: space-evenly` |
|
|
87
|
+
|
|
88
|
+
### Align Items
|
|
89
|
+
|
|
90
|
+
| Class | Value |
|
|
91
|
+
|-------|-------|
|
|
92
|
+
| `.align-start` | `align-items: flex-start` |
|
|
93
|
+
| `.align-end` | `align-items: flex-end` |
|
|
94
|
+
| `.align-center` | `align-items: center` |
|
|
95
|
+
| `.align-baseline` | `align-items: baseline` |
|
|
96
|
+
| `.align-stretch` | `align-items: stretch` |
|
|
97
|
+
|
|
98
|
+
### Align Self
|
|
99
|
+
|
|
100
|
+
| Class | Value |
|
|
101
|
+
|-------|-------|
|
|
102
|
+
| `.align-self-auto` | `align-self: auto` |
|
|
103
|
+
| `.align-self-start` | `align-self: flex-start` |
|
|
104
|
+
| `.align-self-end` | `align-self: flex-end` |
|
|
105
|
+
| `.align-self-center` | `align-self: center` |
|
|
106
|
+
| `.align-self-baseline` | `align-self: baseline` |
|
|
107
|
+
| `.align-self-stretch` | `align-self: stretch` |
|
|
108
|
+
|
|
109
|
+
### Order
|
|
110
|
+
|
|
111
|
+
| Class | Value |
|
|
112
|
+
|-------|-------|
|
|
113
|
+
| `.order-first` | `order: -1` |
|
|
114
|
+
| `.order-0` … `.order-5` | `order: 0` … `order: 5` |
|
|
115
|
+
| `.order-last` | `order: 6` |
|
|
116
|
+
|
|
117
|
+
### Gap
|
|
118
|
+
|
|
119
|
+
| Class | Value |
|
|
120
|
+
|-------|-------|
|
|
121
|
+
| `.gap-0` | `gap: 0` |
|
|
122
|
+
| `.gap-1` | `gap: 0.25rem` |
|
|
123
|
+
| `.gap-2` | `gap: 0.5rem` |
|
|
124
|
+
| `.gap-3` | `gap: 1rem` |
|
|
125
|
+
| `.gap-4` | `gap: 1.5rem` |
|
|
126
|
+
| `.gap-5` | `gap: 3rem` |
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Grid System
|
|
131
|
+
|
|
132
|
+
> 12-column grid with a default gutter of `1.5rem`. All classes are responsive with breakpoint infixes: `sm`, `md`, `lg`, `xl`, `xxl`.
|
|
133
|
+
|
|
134
|
+
### Columns
|
|
135
|
+
|
|
136
|
+
| Class | Purpose |
|
|
137
|
+
|-------|---------|
|
|
138
|
+
| `.col`, `.col-{bp}` | Equal-width flex column |
|
|
139
|
+
| `.col-{bp}-auto` | Auto-width column |
|
|
140
|
+
| `.col-{bp}-{1-12}` | Sized column (out of 12) |
|
|
141
|
+
| `.offset-{bp}-{0-11}` | Left margin offset |
|
|
142
|
+
| `.row-cols-{bp}-auto` | Auto-width children |
|
|
143
|
+
| `.row-cols-{bp}-{1-12}` | Force N equal-width columns per row |
|
|
144
|
+
|
|
145
|
+
### Gutters
|
|
146
|
+
|
|
147
|
+
| Class | Purpose |
|
|
148
|
+
|-------|---------|
|
|
149
|
+
| `.g-{bp}-{0-5}` | Gap (both axes) |
|
|
150
|
+
| `.gx-{bp}-{0-5}` | Horizontal gap |
|
|
151
|
+
| `.gy-{bp}-{0-5}` | Vertical gap |
|
|
152
|
+
|
|
153
|
+
### CSS Grid
|
|
154
|
+
|
|
155
|
+
| Class | Purpose |
|
|
156
|
+
|-------|---------|
|
|
157
|
+
| `.g-col-{bp}-{1-12}` | CSS Grid column span |
|
|
158
|
+
| `.g-start-{bp}-{1-11}` | CSS Grid column start position |
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Typography
|
|
163
|
+
|
|
164
|
+
### Headings
|
|
165
|
+
|
|
166
|
+
| Class | Description |
|
|
167
|
+
|-------|-------------|
|
|
168
|
+
| `.tedi-text--h1` | H1 typography |
|
|
169
|
+
| `.tedi-text--h2` | H2 typography |
|
|
170
|
+
| `.tedi-text--h3` | H3 typography |
|
|
171
|
+
| `.tedi-text--h4` | H4 typography |
|
|
172
|
+
| `.tedi-text--h5` | H5 typography |
|
|
173
|
+
| `.tedi-text--h6` | H6 typography |
|
|
174
|
+
|
|
175
|
+
### Body Text Sizes
|
|
176
|
+
|
|
177
|
+
| Class | Description |
|
|
178
|
+
|-------|-------------|
|
|
179
|
+
| `.tedi-text--default` | Body regular (includes font-family, color) |
|
|
180
|
+
| `.tedi-text--small` | Body small |
|
|
181
|
+
| `.text-subtitle` | Subtitle (uppercase) |
|
|
182
|
+
| `.text-subtitle.text-small` | Small subtitle |
|
|
183
|
+
| `.text-extra-small` | Extra small text |
|
|
184
|
+
|
|
185
|
+
### Text Colors
|
|
186
|
+
|
|
187
|
+
| Class | CSS Variable |
|
|
188
|
+
|-------|-------------|
|
|
189
|
+
| `.tedi-text--default`, `.tedi-text--primary` | `--general-text-primary` |
|
|
190
|
+
| `.tedi-text--secondary` | `--general-text-secondary` |
|
|
191
|
+
| `.tedi-text--tertiary` | `--general-text-tertiary` |
|
|
192
|
+
| `.tedi-text--white` | `--general-text-white` |
|
|
193
|
+
| `.tedi-text--disabled` | `--general-text-disabled` |
|
|
194
|
+
| `.tedi-text--brand` | `--general-text-brand` |
|
|
195
|
+
| `.tedi-text--success` | `--general-status-success-text` |
|
|
196
|
+
| `.tedi-text--warning` | `--general-status-warning-text` |
|
|
197
|
+
| `.tedi-text--danger` | `--general-status-danger-text` |
|
|
198
|
+
| `.tedi-text--info` | `--general-status-info-text` |
|
|
199
|
+
| `.tedi-text--neutral` | `--general-status-neutral-text` |
|
|
200
|
+
|
|
201
|
+
### Text Transform
|
|
202
|
+
|
|
203
|
+
| Class | Effect |
|
|
204
|
+
|-------|--------|
|
|
205
|
+
| `.text-uppercase` | `text-transform: uppercase` |
|
|
206
|
+
| `.text-lowercase` | `text-transform: lowercase` |
|
|
207
|
+
| `.text-capitalize` | `text-transform: capitalize` |
|
|
208
|
+
| `.text-capitalize-first` | Capitalizes first letter only (via `::first-letter`) |
|
|
209
|
+
|
|
210
|
+
### Text Wrapping & Whitespace
|
|
211
|
+
|
|
212
|
+
| Class | Effect |
|
|
213
|
+
|-------|--------|
|
|
214
|
+
| `.text-nowrap` | `white-space: nowrap` |
|
|
215
|
+
| `.text-break-all` | `word-break: break-all` |
|
|
216
|
+
| `.text-break-word` | `overflow-wrap: break-word` |
|
|
217
|
+
| `.text-break-spaces` | `white-space: break-spaces` |
|
|
218
|
+
|
|
219
|
+
### Text Weight & Style
|
|
220
|
+
|
|
221
|
+
| Class | Effect |
|
|
222
|
+
|-------|--------|
|
|
223
|
+
| `.text-bold` | `font-weight: 700` |
|
|
224
|
+
| `.text-thin` | `font-weight: 300` |
|
|
225
|
+
| `.text-italic` | `font-style: italic` |
|
|
226
|
+
|
|
227
|
+
### Text Alignment
|
|
228
|
+
|
|
229
|
+
| Class | Effect |
|
|
230
|
+
|-------|--------|
|
|
231
|
+
| `.text-center` | `text-align: center` |
|
|
232
|
+
| `.text-left` | `text-align: left` |
|
|
233
|
+
| `.text-right` | `text-align: right` |
|
|
234
|
+
|
|
235
|
+
### Text Line Height
|
|
236
|
+
|
|
237
|
+
| Class | Effect |
|
|
238
|
+
|-------|--------|
|
|
239
|
+
| `.text-line-normal` | `line-height: normal` |
|
|
240
|
+
| `.text-line-condensed` | `line-height: 1` |
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## Icons
|
|
245
|
+
|
|
246
|
+
| Class | Description |
|
|
247
|
+
|-------|-------------|
|
|
248
|
+
| `.material-symbols` | Base class for Material Symbols icons |
|
|
249
|
+
| `.material-symbols--outlined` | Outlined icon variant |
|
|
250
|
+
| `.material-symbols--rounded` | Rounded icon variant |
|
|
251
|
+
| `.material-symbols--sharp` | Sharp icon variant |
|
|
252
|
+
|
|
253
|
+
**Usage:**
|
|
254
|
+
|
|
255
|
+
```html
|
|
256
|
+
<span class="material-symbols material-symbols--outlined">home</span>
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Links
|
|
262
|
+
|
|
263
|
+
| Class | Effect |
|
|
264
|
+
|-------|--------|
|
|
265
|
+
| `a.link-white` | White link color (`--link-white-default`) |
|
|
266
|
+
| `a.no-underline` | Removes text-decoration underline |
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Print Utilities
|
|
271
|
+
|
|
272
|
+
> These classes only take effect inside `@media print`.
|
|
273
|
+
|
|
274
|
+
| Class | Effect |
|
|
275
|
+
|-------|--------|
|
|
276
|
+
| `.no-print` | Hidden when printing |
|
|
277
|
+
| `.no-print.show-print` | Override to show in print |
|
|
278
|
+
|
|
279
|
+
### Page Break Control
|
|
280
|
+
|
|
281
|
+
Available for `break-before`, `break-after`, and `break-inside`:
|
|
282
|
+
|
|
283
|
+
| Class Pattern | Values |
|
|
284
|
+
|--------------|--------|
|
|
285
|
+
| `.break-before-{value}` | `auto`, `avoid`, `avoid-column`, `avoid-page`, `avoid-region` |
|
|
286
|
+
| `.break-after-{value}` | `auto`, `avoid`, `avoid-column`, `avoid-page`, `avoid-region` |
|
|
287
|
+
| `.break-inside-{value}` | `auto`, `avoid`, `avoid-column`, `avoid-page`, `avoid-region` |
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## SCSS Mixins
|
|
292
|
+
|
|
293
|
+
### General Mixins
|
|
294
|
+
|
|
295
|
+
#### `print-grayscale`
|
|
296
|
+
|
|
297
|
+
Applies grayscale filter in print media.
|
|
298
|
+
|
|
299
|
+
```scss
|
|
300
|
+
@use 'mixins';
|
|
301
|
+
|
|
302
|
+
.my-colored-element {
|
|
303
|
+
color: var(--color-primary);
|
|
304
|
+
@include mixins.print-grayscale;
|
|
305
|
+
}
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
#### `visually-hidden`
|
|
309
|
+
|
|
310
|
+
Hides an element visually while keeping it accessible to screen readers.
|
|
311
|
+
|
|
312
|
+
```scss
|
|
313
|
+
@use 'mixins';
|
|
314
|
+
|
|
315
|
+
.my-label {
|
|
316
|
+
@include mixins.visually-hidden;
|
|
317
|
+
}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
#### `focus-element`
|
|
321
|
+
|
|
322
|
+
Applies the standard accessible focus outline. Customizable via `--global-outline-color` and `--global-outline-offset` CSS variables.
|
|
323
|
+
|
|
324
|
+
```scss
|
|
325
|
+
@use 'mixins';
|
|
326
|
+
|
|
327
|
+
.my-interactive-element:focus {
|
|
328
|
+
@include mixins.focus-element;
|
|
329
|
+
}
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
#### `button-reset`
|
|
333
|
+
|
|
334
|
+
Resets all default button styling (padding, font, color, cursor, border, background). Includes disabled cursor handling.
|
|
335
|
+
|
|
336
|
+
```scss
|
|
337
|
+
@use 'mixins';
|
|
338
|
+
|
|
339
|
+
.my-custom-button {
|
|
340
|
+
@include mixins.button-reset;
|
|
341
|
+
}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### Breakpoint Mixins
|
|
345
|
+
|
|
346
|
+
#### `media-breakpoint-up($name)`
|
|
347
|
+
|
|
348
|
+
Applies styles from the given breakpoint and up (min-width).
|
|
349
|
+
|
|
350
|
+
```scss
|
|
351
|
+
@use 'bootstrap-utility/breakpoints';
|
|
352
|
+
|
|
353
|
+
.sidebar {
|
|
354
|
+
display: none;
|
|
355
|
+
|
|
356
|
+
@include breakpoints.media-breakpoint-up(md) {
|
|
357
|
+
display: block; // visible from 768px and up
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
#### `media-breakpoint-down($name)`
|
|
363
|
+
|
|
364
|
+
Applies styles below the given breakpoint (max-width).
|
|
365
|
+
|
|
366
|
+
```scss
|
|
367
|
+
@use 'bootstrap-utility/breakpoints';
|
|
368
|
+
|
|
369
|
+
.mobile-menu {
|
|
370
|
+
@include breakpoints.media-breakpoint-down(lg) {
|
|
371
|
+
display: block; // visible below 992px
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
#### `media-breakpoint-between($lower, $upper)`
|
|
377
|
+
|
|
378
|
+
Applies styles between two breakpoints.
|
|
379
|
+
|
|
380
|
+
```scss
|
|
381
|
+
@use 'bootstrap-utility/breakpoints';
|
|
382
|
+
|
|
383
|
+
.tablet-only {
|
|
384
|
+
@include breakpoints.media-breakpoint-between(md, lg) {
|
|
385
|
+
font-size: 1.1rem; // 768px to 991.98px
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
#### `media-breakpoint-only($name)`
|
|
391
|
+
|
|
392
|
+
Applies styles only at the given breakpoint range.
|
|
393
|
+
|
|
394
|
+
```scss
|
|
395
|
+
@use 'bootstrap-utility/breakpoints';
|
|
396
|
+
|
|
397
|
+
.sm-special {
|
|
398
|
+
@include breakpoints.media-breakpoint-only(sm) {
|
|
399
|
+
padding: 1rem; // 576px to 767.98px only
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
### Typography Mixins
|
|
405
|
+
|
|
406
|
+
#### `heading-styles($level)`
|
|
407
|
+
|
|
408
|
+
Applies heading typography (font-size, font-weight, line-height) from CSS variables.
|
|
409
|
+
|
|
410
|
+
```scss
|
|
411
|
+
@use 'typography';
|
|
412
|
+
|
|
413
|
+
.my-title {
|
|
414
|
+
@include typography.heading-styles(h2);
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
## Breakpoints Reference
|
|
421
|
+
|
|
422
|
+
| Name | Min-width | Typical Usage |
|
|
423
|
+
|------|-----------|---------------|
|
|
424
|
+
| `xs` | 0 | Mobile (default) |
|
|
425
|
+
| `sm` | 576px | Large phones |
|
|
426
|
+
| `md` | 768px | Tablets |
|
|
427
|
+
| `lg` | 992px | Desktops |
|
|
428
|
+
| `xl` | 1200px | Large desktops |
|
|
429
|
+
| `xxl` | 1400px | Extra large screens |
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
## Spacing Scale Reference
|
|
434
|
+
|
|
435
|
+
Used by gap, gutter, and spacer utilities:
|
|
436
|
+
|
|
437
|
+
| Key | Value |
|
|
438
|
+
|-----|-------|
|
|
439
|
+
| `0` | `0` |
|
|
440
|
+
| `1` | `0.25rem` (4px) |
|
|
441
|
+
| `2` | `0.5rem` (8px) |
|
|
442
|
+
| `3` | `1rem` (16px) |
|
|
443
|
+
| `4` | `1.5rem` (24px) |
|
|
444
|
+
| `5` | `3rem` (48px) |
|