@digicreon/mucss 1.0.0 → 1.2.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 +60 -11
- package/dist/mu.amber.css +2 -2
- package/dist/mu.azure.css +2 -2
- package/dist/mu.blue.css +2 -2
- package/dist/mu.css +2 -2
- package/dist/mu.cyan.css +2 -2
- package/dist/mu.fuchsia.css +2 -2
- package/dist/mu.green.css +2 -2
- package/dist/mu.grey.css +2 -2
- package/dist/mu.indigo.css +2 -2
- package/dist/mu.jade.css +2 -2
- package/dist/mu.lime.css +2 -2
- package/dist/mu.orange.css +2 -2
- package/dist/mu.pink.css +2 -2
- package/dist/mu.pumpkin.css +2 -2
- package/dist/mu.purple.css +2 -2
- package/dist/mu.red.css +2 -2
- package/dist/mu.sand.css +2 -2
- package/dist/mu.slate.css +2 -2
- package/dist/mu.violet.css +2 -2
- package/dist/mu.yellow.css +2 -2
- package/dist/mu.zinc.css +2 -2
- package/documentation/mu.accordion.md +4 -2
- package/documentation/mu.alert.md +22 -14
- package/documentation/mu.badge.md +35 -15
- package/documentation/mu.breadcrumb.md +8 -6
- package/documentation/mu.button.md +39 -28
- package/documentation/mu.card.md +35 -19
- package/documentation/mu.checkbox-radio.md +4 -2
- package/documentation/mu.code.md +85 -0
- package/documentation/mu.colors.md +307 -0
- package/documentation/mu.container.md +87 -0
- package/documentation/mu.dark-mode.md +96 -0
- package/documentation/mu.dropdown.md +32 -27
- package/documentation/mu.embedded.md +101 -0
- package/documentation/mu.figure.md +82 -0
- package/documentation/mu.forms-advanced.md +6 -4
- package/documentation/mu.forms.md +11 -9
- package/documentation/mu.grid.md +7 -1
- package/documentation/mu.group.md +29 -27
- package/documentation/mu.hero.md +200 -0
- package/documentation/mu.link.md +108 -0
- package/documentation/mu.loading.md +4 -2
- package/documentation/mu.modal.md +9 -7
- package/documentation/mu.nav.md +191 -0
- package/documentation/mu.pagination.md +3 -1
- package/documentation/mu.progress.md +31 -14
- package/documentation/mu.range.md +4 -2
- package/documentation/mu.skeleton.md +111 -0
- package/documentation/mu.spinner.md +20 -12
- package/documentation/mu.switch.md +4 -2
- package/documentation/mu.table.md +20 -6
- package/documentation/mu.tabs.md +5 -3
- package/documentation/mu.toast.md +134 -0
- package/documentation/mu.tooltip.md +30 -28
- package/documentation/mu.typography.md +44 -42
- package/documentation/mu.utilities.md +83 -0
- package/documentation/mu.variables.md +276 -0
- package/package.json +5 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# µSwitch
|
|
2
2
|
|
|
3
|
-
**µSwitch** describes the toggle switch controls available natively in [µCSS](.)
|
|
3
|
+
**µSwitch** describes the toggle switch controls available natively in [µCSS](.). Switches are standard checkboxes enhanced with `role="switch"`, which µCSS styles as visual toggle switches without any additional CSS or JavaScript.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -107,4 +107,6 @@ Switches work well inside cards (`<article>`) for settings or preference panels.
|
|
|
107
107
|
|
|
108
108
|
---
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
> See also : [µCheckbox & Radio](mu.checkbox-radio.md) · [µForms](mu.forms.md)
|
|
111
|
+
|
|
112
|
+
→ [See example](../examples/switch.html)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# µTable
|
|
2
2
|
|
|
3
|
-
**µTable** provides enhanced table styles for the [µCSS](.) framework. It adds hover highlights, striped rows, bordered cells, compact padding, and fullwidth layout on top of
|
|
3
|
+
**µTable** provides enhanced table styles for the [µCSS](.) framework. It adds hover highlights, striped rows, bordered cells, compact padding, and fullwidth layout on top of the default table styling.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -116,8 +116,8 @@ All modifier classes can be combined freely. Common combinations:
|
|
|
116
116
|
|
|
117
117
|
| Class | Effect |
|
|
118
118
|
|--------------------|------------------------------------------------------------------------|
|
|
119
|
-
| `.table-hover` | Background highlight on row hover (`--
|
|
120
|
-
| `.table-striped` | Alternating background on odd rows (50% `--
|
|
119
|
+
| `.table-hover` | Background highlight on row hover (`--mu-secondary-background`) |
|
|
120
|
+
| `.table-striped` | Alternating background on odd rows (50% `--mu-secondary-background`) |
|
|
121
121
|
| `.table-bordered` | 1px solid border on table, `<th>`, and `<td>` |
|
|
122
122
|
| `.table-compact` | Reduced padding: `0.25rem 0.5rem` |
|
|
123
123
|
| `.table-fullwidth` | `width: 100%` |
|
|
@@ -138,10 +138,24 @@ For tables wider than their container, wrap them in a scrollable `<div>`:
|
|
|
138
138
|
|
|
139
139
|
---
|
|
140
140
|
|
|
141
|
-
##
|
|
141
|
+
## Implementation note
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
The base styles set `background-color` on individual `<th>` and `<td>` cells rather than on `<tr>` rows. For this reason, `.table-hover` and `.table-striped` target `th` and `td` elements directly instead of `tr`. This ensures the hover and stripe backgrounds correctly override default cell styles.
|
|
144
|
+
|
|
145
|
+
The `.table-bordered` variant uses `color-mix()` to blend `--mu-muted-color` (30%) with `--mu-muted-border-color` (70%) for visible but not heavy cell borders.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Accessibility
|
|
150
|
+
|
|
151
|
+
- Use `<caption>` to provide a descriptive title for the table.
|
|
152
|
+
- Use `<thead>`, `<tbody>`, and `<tfoot>` to group rows semantically.
|
|
153
|
+
- Use `scope="col"` on header cells in `<thead>` and `scope="row"` on row headers.
|
|
154
|
+
- For complex tables, use `aria-describedby` to reference a longer description.
|
|
155
|
+
- Avoid using tables for layout — only use them for tabular data.
|
|
144
156
|
|
|
145
157
|
---
|
|
146
158
|
|
|
147
|
-
|
|
159
|
+
> See also : [µForms](mu.forms.md) · [µGrid](mu.grid.md)
|
|
160
|
+
|
|
161
|
+
→ [See example](../examples/table.html)
|
package/documentation/mu.tabs.md
CHANGED
|
@@ -155,10 +155,12 @@ The active tab is indicated by the `aria-selected="true"` attribute on the `<a>`
|
|
|
155
155
|
|
|
156
156
|
---
|
|
157
157
|
|
|
158
|
-
##
|
|
158
|
+
## Implementation note
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
The base styles apply `list-style: square` to `ul li` elements. µTabs explicitly sets `list-style: none` on `.tabs` and `.tabs li` to neutralize this default and prevent bullet markers from appearing next to tab items.
|
|
161
161
|
|
|
162
162
|
---
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
> See also : [µNav](mu.nav.md) · [µAccordion](mu.accordion.md)
|
|
165
|
+
|
|
166
|
+
→ [See example](../examples/tabs.html)
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# µToast
|
|
2
|
+
|
|
3
|
+
**µToast** is a fixed-position notification wrapper, part of the [µCSS](.) framework. It uses the existing [alert](mu.alert.md) component for content styling and adds 6 positioning options.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Basic usage
|
|
8
|
+
|
|
9
|
+
Wrap an `.alert` inside a `.toast` container with a position class:
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<div class="toast toast-top-right">
|
|
13
|
+
<div class="alert alert-success" role="alert">
|
|
14
|
+
<p>Changes saved.</p>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Positions
|
|
22
|
+
|
|
23
|
+
6 position classes are available:
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<div class="toast toast-top-right">...</div>
|
|
27
|
+
<div class="toast toast-top-left">...</div>
|
|
28
|
+
<div class="toast toast-top-center">...</div>
|
|
29
|
+
<div class="toast toast-bottom-right">...</div>
|
|
30
|
+
<div class="toast toast-bottom-left">...</div>
|
|
31
|
+
<div class="toast toast-bottom-center">...</div>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
| Class | Placement |
|
|
35
|
+
|-------|-----------|
|
|
36
|
+
| `.toast-top-right` | `top: 1rem; right: 1rem` |
|
|
37
|
+
| `.toast-top-left` | `top: 1rem; left: 1rem` |
|
|
38
|
+
| `.toast-top-center` | `top: 1rem; left: 50%; transform: translateX(-50%)` |
|
|
39
|
+
| `.toast-bottom-right` | `bottom: 1rem; right: 1rem` |
|
|
40
|
+
| `.toast-bottom-left` | `bottom: 1rem; left: 1rem` |
|
|
41
|
+
| `.toast-bottom-center` | `bottom: 1rem; left: 50%; transform: translateX(-50%)` |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Color variants
|
|
46
|
+
|
|
47
|
+
Toasts reuse the alert color variants. All 11 color roles are available:
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<div class="toast toast-top-right">
|
|
51
|
+
<div class="alert alert-primary" role="alert"><p>Primary toast.</p></div>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div class="toast toast-top-right">
|
|
55
|
+
<div class="alert alert-error" role="alert"><p>Error toast.</p></div>
|
|
56
|
+
</div>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Available variants: `alert-primary`, `alert-secondary`, `alert-tertiary`, `alert-contrast`, `alert-accent`, `alert-success`, `alert-info`, `alert-warning`, `alert-error`, `alert-pop`, `alert-spark`.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## With title
|
|
64
|
+
|
|
65
|
+
Use `.alert-title` for a bold heading inside the toast:
|
|
66
|
+
|
|
67
|
+
```html
|
|
68
|
+
<div class="toast toast-top-right">
|
|
69
|
+
<div class="alert alert-success" role="alert">
|
|
70
|
+
<span class="alert-title">Saved!</span>
|
|
71
|
+
<p>Your changes have been saved.</p>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Dismissible
|
|
79
|
+
|
|
80
|
+
Add `.alert-dismissible` and an `.alert-close` button:
|
|
81
|
+
|
|
82
|
+
```html
|
|
83
|
+
<div class="toast toast-top-right">
|
|
84
|
+
<div class="alert alert-info alert-dismissible" role="alert">
|
|
85
|
+
<p>This toast can be dismissed.</p>
|
|
86
|
+
<button class="alert-close" aria-label="Close" onclick="this.closest('.toast').remove()">×</button>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## CSS classes reference
|
|
94
|
+
|
|
95
|
+
| Class | Description |
|
|
96
|
+
|-------|-------------|
|
|
97
|
+
| `.toast` | Fixed-position wrapper (`position: fixed`, `z-index: 1050`, `max-width: 350px`) |
|
|
98
|
+
| `.toast-top-right` | Position top-right |
|
|
99
|
+
| `.toast-top-left` | Position top-left |
|
|
100
|
+
| `.toast-top-center` | Position top-center |
|
|
101
|
+
| `.toast-bottom-right` | Position bottom-right |
|
|
102
|
+
| `.toast-bottom-left` | Position bottom-left |
|
|
103
|
+
| `.toast-bottom-center` | Position bottom-center |
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Responsive behavior
|
|
108
|
+
|
|
109
|
+
On viewports narrower than 640px, all toast positions switch to full-width (`left: 1rem; right: 1rem; max-width: none`) to avoid content overflow on mobile devices.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Styling details
|
|
114
|
+
|
|
115
|
+
| Property | Value |
|
|
116
|
+
|----------|-------|
|
|
117
|
+
| Position | `fixed` |
|
|
118
|
+
| Z-index | `1050` |
|
|
119
|
+
| Max-width | `350px` (none on mobile) |
|
|
120
|
+
| Spacing from edge | `1rem` |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Accessibility
|
|
125
|
+
|
|
126
|
+
- Use `role="alert"` on the inner alert element so screen readers announce the notification.
|
|
127
|
+
- Dismissible toasts should include `aria-label="Close"` on the close button.
|
|
128
|
+
- Auto-dismiss timing (e.g. 4 seconds) is the application's JS responsibility — µCSS provides only the CSS positioning.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
> See also : [µAlert](mu.alert.md)
|
|
133
|
+
|
|
134
|
+
→ [See example](../examples/toast.html)
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# µTooltip
|
|
2
2
|
|
|
3
|
-
**µTooltip**
|
|
3
|
+
**µTooltip** provides pure CSS tooltips via the `data-tooltip` attribute, styled by [µCSS](.). No JavaScript is required: tooltips appear on hover or focus.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Basic usage
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Add the `data-tooltip` attribute to any HTML element to display a tooltip on hover. By default, the tooltip appears above the element.
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
12
|
<span data-tooltip="This is a tooltip">Hover me</span>
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
For a clear visual rendering on inline text, you can add an underline style:
|
|
16
16
|
|
|
17
17
|
```html
|
|
18
18
|
<span data-tooltip="This is a tooltip"
|
|
@@ -23,14 +23,14 @@ Pour un rendu visuel clair sur du texte inline, on peut ajouter un style de soul
|
|
|
23
23
|
|
|
24
24
|
## Placement
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
The `data-placement` attribute controls the tooltip position. Four positions are available:
|
|
27
27
|
|
|
28
|
-
|
|
|
29
|
-
|
|
30
|
-
| `top` |
|
|
31
|
-
| `bottom` |
|
|
32
|
-
| `left` |
|
|
33
|
-
| `right` |
|
|
28
|
+
| Value | Position |
|
|
29
|
+
|-------|----------|
|
|
30
|
+
| `top` | Above (default) |
|
|
31
|
+
| `bottom` | Below |
|
|
32
|
+
| `left` | To the left |
|
|
33
|
+
| `right` | To the right |
|
|
34
34
|
|
|
35
35
|
```html
|
|
36
36
|
<span data-tooltip="Top tooltip" data-placement="top">Top</span>
|
|
@@ -41,22 +41,22 @@ L'attribut `data-placement` controle la position du tooltip. Quatre positions so
|
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
-
##
|
|
44
|
+
## On buttons
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Tooltips work on buttons to provide additional context about the action.
|
|
47
47
|
|
|
48
48
|
```html
|
|
49
49
|
<button class="btn btn-primary" data-tooltip="Save your changes">Save</button>
|
|
50
|
-
<button class="btn btn-
|
|
50
|
+
<button class="btn btn-outline btn-error"
|
|
51
51
|
data-tooltip="This action cannot be undone"
|
|
52
52
|
data-placement="bottom">Delete</button>
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
---
|
|
56
56
|
|
|
57
|
-
##
|
|
57
|
+
## On links
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
Add a tooltip to a link to describe the destination or action.
|
|
60
60
|
|
|
61
61
|
```html
|
|
62
62
|
<p>Visit the <a href="#" data-tooltip="Go to the homepage">homepage</a>
|
|
@@ -66,9 +66,9 @@ data-placement="bottom">documentation</a>.</p>
|
|
|
66
66
|
|
|
67
67
|
---
|
|
68
68
|
|
|
69
|
-
##
|
|
69
|
+
## On form fields
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
Tooltips can be placed on form elements to guide the user.
|
|
72
72
|
|
|
73
73
|
```html
|
|
74
74
|
<label>Username
|
|
@@ -80,19 +80,21 @@ Les tooltips peuvent etre places sur des elements de formulaire pour guider l'ut
|
|
|
80
80
|
|
|
81
81
|
---
|
|
82
82
|
|
|
83
|
-
##
|
|
83
|
+
## Attribute summary
|
|
84
84
|
|
|
85
|
-
|
|
|
86
|
-
|
|
87
|
-
| `data-tooltip` |
|
|
88
|
-
| `data-placement` |
|
|
85
|
+
| Attribute | Required | Description |
|
|
86
|
+
|-----------|----------|-------------|
|
|
87
|
+
| `data-tooltip` | Yes | Text displayed in the tooltip |
|
|
88
|
+
| `data-placement` | No | Position: `top` (default), `bottom`, `left`, `right` |
|
|
89
89
|
|
|
90
90
|
---
|
|
91
91
|
|
|
92
|
-
##
|
|
92
|
+
## Accessibility
|
|
93
93
|
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
94
|
+
- Tooltips are keyboard accessible via focus (`:focus` in addition to `:hover`).
|
|
95
|
+
- The `data-tooltip` content is read by assistive technologies.
|
|
96
|
+
- Avoid placing essential information only in a tooltip; the content should remain understandable without hover interaction.
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
> See also : [µLink](mu.link.md)
|
|
99
|
+
|
|
100
|
+
> [See example](../examples/tooltip.html)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# µTypography
|
|
2
2
|
|
|
3
|
-
**µTypography**
|
|
3
|
+
**µTypography** covers native HTML typographic elements styled by [µCSS](.). No additional CSS file is needed: headings, paragraphs, lists, quotes, code and inline semantic elements are styled automatically.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Headings
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
The six HTML heading levels are styled with progressive sizes and weights.
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
12
|
<h1>Heading 1</h1>
|
|
@@ -19,7 +19,7 @@ Les six niveaux de titres HTML sont styles avec des tailles et graisses progress
|
|
|
19
19
|
|
|
20
20
|
### Heading group
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
The `<hgroup>` element allows associating a main heading with a subtitle or tagline.
|
|
23
23
|
|
|
24
24
|
```html
|
|
25
25
|
<hgroup>
|
|
@@ -28,13 +28,13 @@ L'element `<hgroup>` permet d'associer un titre principal a un sous-titre ou une
|
|
|
28
28
|
</hgroup>
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
The paragraph inside `<hgroup>` is displayed in a muted style (secondary color, reduced size).
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
35
|
-
##
|
|
35
|
+
## Paragraphs
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Paragraphs use the default µCSS style with harmonious vertical spacing.
|
|
38
38
|
|
|
39
39
|
```html
|
|
40
40
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
@@ -45,9 +45,9 @@ dolore eu fugiat nulla pariatur.</p>
|
|
|
45
45
|
|
|
46
46
|
---
|
|
47
47
|
|
|
48
|
-
##
|
|
48
|
+
## Blockquotes
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
The `<blockquote>` element displays a quote with a distinct visual style (side border, indentation). A `<footer>` with `<cite>` allows attributing the source.
|
|
51
51
|
|
|
52
52
|
```html
|
|
53
53
|
<blockquote>
|
|
@@ -58,9 +58,9 @@ L'element `<blockquote>` affiche une citation avec un style visuel distinct (bor
|
|
|
58
58
|
|
|
59
59
|
---
|
|
60
60
|
|
|
61
|
-
##
|
|
61
|
+
## Lists
|
|
62
62
|
|
|
63
|
-
###
|
|
63
|
+
### Unordered list
|
|
64
64
|
|
|
65
65
|
```html
|
|
66
66
|
<ul>
|
|
@@ -75,7 +75,7 @@ L'element `<blockquote>` affiche une citation avec un style visuel distinct (bor
|
|
|
75
75
|
</ul>
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
###
|
|
78
|
+
### Ordered list
|
|
79
79
|
|
|
80
80
|
```html
|
|
81
81
|
<ol>
|
|
@@ -85,7 +85,7 @@ L'element `<blockquote>` affiche une citation avec un style visuel distinct (bor
|
|
|
85
85
|
</ol>
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
###
|
|
88
|
+
### Definition list
|
|
89
89
|
|
|
90
90
|
```html
|
|
91
91
|
<dl>
|
|
@@ -98,22 +98,22 @@ L'element `<blockquote>` affiche une citation avec un style visuel distinct (bor
|
|
|
98
98
|
|
|
99
99
|
---
|
|
100
100
|
|
|
101
|
-
##
|
|
101
|
+
## Inline semantic text
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
µCSS automatically styles inline semantic elements:
|
|
104
104
|
|
|
105
|
-
| Element |
|
|
106
|
-
|
|
107
|
-
| `<strong>` | **
|
|
108
|
-
| `<em>` | *
|
|
109
|
-
| `<u>` |
|
|
110
|
-
| `<small>` |
|
|
111
|
-
| `<del>` | ~~
|
|
112
|
-
| `<ins>` |
|
|
113
|
-
| `<abbr>` |
|
|
114
|
-
| `<mark>` |
|
|
115
|
-
| `<sub>` |
|
|
116
|
-
| `<sup>` |
|
|
105
|
+
| Element | Rendering | Usage |
|
|
106
|
+
|---------|-----------|-------|
|
|
107
|
+
| `<strong>` | **Bold** | Strong importance |
|
|
108
|
+
| `<em>` | *Italic* | Emphasis |
|
|
109
|
+
| `<u>` | Underlined | Annotation |
|
|
110
|
+
| `<small>` | Small text | Legal mentions, notes |
|
|
111
|
+
| `<del>` | ~~Strikethrough~~ | Deleted text |
|
|
112
|
+
| `<ins>` | Underlined | Inserted text |
|
|
113
|
+
| `<abbr>` | Dotted | Abbreviation (with `title`) |
|
|
114
|
+
| `<mark>` | Highlighted | Highlighted text |
|
|
115
|
+
| `<sub>` | Subscript | Formulas, notes |
|
|
116
|
+
| `<sup>` | Superscript | References, powers |
|
|
117
117
|
|
|
118
118
|
```html
|
|
119
119
|
<p><strong>Bold text</strong> and <em>italic text</em> and <u>underlined text</u>.</p>
|
|
@@ -127,17 +127,17 @@ PicoCSS style automatiquement les elements semantiques inline :
|
|
|
127
127
|
|
|
128
128
|
## Code
|
|
129
129
|
|
|
130
|
-
###
|
|
130
|
+
### Inline code
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
The `<code>` element displays code in a monospace font with a slightly colored background.
|
|
133
133
|
|
|
134
134
|
```html
|
|
135
135
|
<p>Inline <code>code element</code> within text.</p>
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
-
###
|
|
138
|
+
### Code block
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
The `<pre><code>` combination displays a preformatted code block with a distinct background and horizontal scrolling if needed.
|
|
141
141
|
|
|
142
142
|
```html
|
|
143
143
|
<pre><code><div class="container">
|
|
@@ -148,9 +148,9 @@ Le couple `<pre><code>` affiche un bloc de code preformate avec fond distinct et
|
|
|
148
148
|
|
|
149
149
|
---
|
|
150
150
|
|
|
151
|
-
##
|
|
151
|
+
## Keyboard
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
The `<kbd>` element represents a key or key combination with a physical key style.
|
|
154
154
|
|
|
155
155
|
```html
|
|
156
156
|
<p>Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy, <kbd>Ctrl</kbd> + <kbd>V</kbd> to paste.</p>
|
|
@@ -158,9 +158,9 @@ L'element `<kbd>` represente une touche ou combinaison de touches avec un style
|
|
|
158
158
|
|
|
159
159
|
---
|
|
160
160
|
|
|
161
|
-
##
|
|
161
|
+
## Horizontal separator
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
The `<hr>` element displays a thin line separating two content blocks.
|
|
164
164
|
|
|
165
165
|
```html
|
|
166
166
|
<p>Content above the separator.</p>
|
|
@@ -172,7 +172,7 @@ L'element `<hr>` affiche un trait fin separant deux blocs de contenu.
|
|
|
172
172
|
|
|
173
173
|
## Figure
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
The `<figure>` element wraps content (table, image, etc.) with a caption via `<figcaption>`.
|
|
176
176
|
|
|
177
177
|
```html
|
|
178
178
|
<figure>
|
|
@@ -186,11 +186,13 @@ L'element `<figure>` encadre un contenu (tableau, image, etc.) avec une legende
|
|
|
186
186
|
|
|
187
187
|
---
|
|
188
188
|
|
|
189
|
-
##
|
|
189
|
+
## Accessibility
|
|
190
190
|
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
- `<blockquote>`
|
|
194
|
-
-
|
|
191
|
+
- Use heading levels in hierarchical order (`h1` > `h2` > `h3`...) for screen reader navigation.
|
|
192
|
+
- The `title` attribute on `<abbr>` provides the full form of the abbreviation to assistive technologies.
|
|
193
|
+
- `<blockquote>` with `<cite>` allows screen readers to identify the source of a quote.
|
|
194
|
+
- The `<mark>` element is announced as "highlight" by screen readers.
|
|
195
195
|
|
|
196
|
-
|
|
196
|
+
> See also : [µLink](mu.link.md) · [µCode](mu.code.md)
|
|
197
|
+
|
|
198
|
+
> [See example](../examples/typography.html)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# µUtilities
|
|
2
|
+
|
|
3
|
+
**µUtilities** provides generic CSS utility classes in [µCSS](.). These classes can be applied to any element.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Positioning
|
|
8
|
+
|
|
9
|
+
Three classes for sticky and fixed positioning, defined in `css/mu.utilities.css`:
|
|
10
|
+
|
|
11
|
+
| Class | Effect |
|
|
12
|
+
|-------|--------|
|
|
13
|
+
| `.sticky-top` | `position: sticky; top: 0` — stays in flow, sticks to the top on scroll |
|
|
14
|
+
| `.fixed-top` | `position: fixed; top: 0; right: 0; left: 0` — always fixed to the viewport top |
|
|
15
|
+
| `.fixed-bottom` | `position: fixed; bottom: 0; right: 0; left: 0` — fixed to the viewport bottom |
|
|
16
|
+
|
|
17
|
+
### Usage examples
|
|
18
|
+
|
|
19
|
+
**Sticky navigation bar** (recommended for navbars):
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<nav class="sticky-top">
|
|
23
|
+
<ul><li><strong>Brand</strong></li></ul>
|
|
24
|
+
<input type="checkbox" id="nav-s" class="navbar-toggle" hidden>
|
|
25
|
+
<label for="nav-s" class="navbar-burger">☰</label>
|
|
26
|
+
<ul class="navbar-menu">
|
|
27
|
+
<li><a href="#">Home</a></li>
|
|
28
|
+
<li><a href="#">About</a></li>
|
|
29
|
+
</ul>
|
|
30
|
+
</nav>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Sticky table header**:
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<table>
|
|
37
|
+
<thead class="sticky-top">
|
|
38
|
+
<tr><th>Name</th><th>Email</th></tr>
|
|
39
|
+
</thead>
|
|
40
|
+
<tbody>…</tbody>
|
|
41
|
+
</table>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Sticky sidebar / table of contents**:
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<aside class="sticky-top" style="top: 1rem;">
|
|
48
|
+
<nav>
|
|
49
|
+
<ul>
|
|
50
|
+
<li><a href="#section-1">Section 1</a></li>
|
|
51
|
+
<li><a href="#section-2">Section 2</a></li>
|
|
52
|
+
</ul>
|
|
53
|
+
</nav>
|
|
54
|
+
</aside>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Fixed bottom action bar** (mobile):
|
|
58
|
+
|
|
59
|
+
```html
|
|
60
|
+
<div class="fixed-bottom" style="padding: 1rem; background: var(--mu-background-color);">
|
|
61
|
+
<button class="btn btn-primary" style="width: 100%;">Confirm</button>
|
|
62
|
+
</div>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Nav-specific overrides
|
|
66
|
+
|
|
67
|
+
When used on a `<nav>`, these classes automatically add `z-index: 100` and `box-shadow` to elevate the navbar above content. See [µNav](mu.nav.md#sticky-and-fixed-navbars).
|
|
68
|
+
|
|
69
|
+
### Notes
|
|
70
|
+
|
|
71
|
+
- `.sticky-top` requires a scrollable ancestor — the element stays in the document flow and sticks when scrolled past.
|
|
72
|
+
- `.fixed-top` and `.fixed-bottom` remove the element from the flow — add `padding-top` or `padding-bottom` on `<body>` to prevent content from being hidden behind.
|
|
73
|
+
- Override the default `top: 0` on `.sticky-top` via inline style if you need an offset (e.g., `style="top: 1rem"`).
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Color utilities
|
|
78
|
+
|
|
79
|
+
Text, background, and border color classes are documented in [µColors](mu.colors.md#utility-classes).
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
> See also : [µColors](mu.colors.md) · [µNav](mu.nav.md) · [µTable](mu.table.md)
|