@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
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# µEmbedded
|
|
2
|
+
|
|
3
|
+
**µEmbedded** describes the styling of embedded content in [µCSS](.): images (`<img>`), videos (`<video>`), audio (`<audio>`), SVG, and canvas.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
Images are responsive by default:
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<img src="photo.jpg" alt="Description de la photo">
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Images
|
|
18
|
+
|
|
19
|
+
Images receive `max-width: 100%` and `height: auto`, making them responsive without any additional class:
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<img src="large-photo.jpg" alt="Photo responsive">
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
| Property | Value |
|
|
26
|
+
|----------|-------|
|
|
27
|
+
| `max-width` | `100%` |
|
|
28
|
+
| `height` | `auto` |
|
|
29
|
+
| `border-style` | `none` |
|
|
30
|
+
|
|
31
|
+
The image never exceeds the width of its container and maintains its aspect ratio.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Video and audio
|
|
36
|
+
|
|
37
|
+
The `<video>` and `<audio>` elements are displayed as `inline-block`:
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<video controls>
|
|
41
|
+
<source src="video.mp4" type="video/mp4">
|
|
42
|
+
</video>
|
|
43
|
+
|
|
44
|
+
<audio controls>
|
|
45
|
+
<source src="audio.mp3" type="audio/mpeg">
|
|
46
|
+
</audio>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
An `<audio>` element without the `controls` attribute is hidden (`display: none`).
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## SVG
|
|
54
|
+
|
|
55
|
+
SVGs inherit the text color via `fill: currentColor`, making them automatically theme-aware:
|
|
56
|
+
|
|
57
|
+
```html
|
|
58
|
+
<svg width="24" height="24" viewBox="0 0 24 24">
|
|
59
|
+
<path d="M12 2L2 22h20L12 2z"/>
|
|
60
|
+
</svg>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The SVG will adapt to the surrounding text color, including when toggling between light and dark modes.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Canvas
|
|
68
|
+
|
|
69
|
+
The `<canvas>` element is displayed as `inline-block`:
|
|
70
|
+
|
|
71
|
+
```html
|
|
72
|
+
<canvas width="300" height="150"></canvas>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Inside a figure
|
|
78
|
+
|
|
79
|
+
Combine embedded content with `<figure>` to add a caption:
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<figure>
|
|
83
|
+
<img src="photo.jpg" alt="Paysage">
|
|
84
|
+
<figcaption>Un paysage de montagne</figcaption>
|
|
85
|
+
</figure>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
See [µFigure](mu.figure.md) for more details.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Accessibility
|
|
93
|
+
|
|
94
|
+
- Always provide a descriptive `alt` attribute on `<img>` elements. Use `alt=""` for decorative images.
|
|
95
|
+
- Add subtitles (`<track>`) to `<video>` elements.
|
|
96
|
+
- The `controls` attribute on `<audio>` and `<video>` is essential for accessibility.
|
|
97
|
+
- Inline SVGs should have a `role="img"` and an `aria-label` or an internal `<title>`.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
> See also : [µFigure](mu.figure.md) · [µTypography](mu.typography.md)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# µFigure
|
|
2
|
+
|
|
3
|
+
**µFigure** describes the styling of the `<figure>` element and its `<figcaption>` caption in [µCSS](.).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
Wrap illustrative content in `<figure>` with a `<figcaption>` caption:
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<figure>
|
|
13
|
+
<img src="photo.jpg" alt="Paysage de montagne">
|
|
14
|
+
<figcaption>Vue depuis le sommet du col</figcaption>
|
|
15
|
+
</figure>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Style
|
|
21
|
+
|
|
22
|
+
The `<figure>` element is reset with no margins or padding. The `<figcaption>` caption uses a muted color:
|
|
23
|
+
|
|
24
|
+
| Element | Property | Value |
|
|
25
|
+
|---------|----------|-------|
|
|
26
|
+
| `<figure>` | `display` | `block` |
|
|
27
|
+
| `<figure>` | `margin` | `0` |
|
|
28
|
+
| `<figure>` | `padding` | `0` |
|
|
29
|
+
| `<figcaption>` | `padding` | `calc(var(--mu-spacing) * 0.5) 0` |
|
|
30
|
+
| `<figcaption>` | `color` | `--mu-muted-color` |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## With an image
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<figure>
|
|
38
|
+
<img src="graphique.png" alt="Graphique des ventes">
|
|
39
|
+
<figcaption>Ventes trimestrielles 2024</figcaption>
|
|
40
|
+
</figure>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The image is responsive by default (`max-width: 100%`, see [µEmbedded](mu.embedded.md)).
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## With a code block
|
|
48
|
+
|
|
49
|
+
`<figure>` can wrap a code block:
|
|
50
|
+
|
|
51
|
+
```html
|
|
52
|
+
<figure>
|
|
53
|
+
<pre><code>const greeting = "Hello, World!";
|
|
54
|
+
console.log(greeting);</code></pre>
|
|
55
|
+
<figcaption>Exemple de code JavaScript</figcaption>
|
|
56
|
+
</figure>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## With a quote
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<figure>
|
|
65
|
+
<blockquote>
|
|
66
|
+
La simplicite est la sophistication supreme.
|
|
67
|
+
</blockquote>
|
|
68
|
+
<figcaption>Leonard de Vinci</figcaption>
|
|
69
|
+
</figure>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Accessibility
|
|
75
|
+
|
|
76
|
+
- Always provide an `alt` attribute on images contained within `<figure>`.
|
|
77
|
+
- `<figcaption>` serves as an accessible caption; it is automatically associated with the `<figure>` by screen readers.
|
|
78
|
+
- For figures without `<figcaption>`, add an `aria-label` on the `<figure>`.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
> See also : [µEmbedded](mu.embedded.md) · [µCode](mu.code.md) · [µTypography](mu.typography.md)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# µForms (advanced)
|
|
2
2
|
|
|
3
|
-
**µForms (advanced)** describes the specialized native input types styled by [µCSS](.)
|
|
3
|
+
**µForms (advanced)** describes the specialized native input types styled by [µCSS](.). These include color pickers, date/time inputs, file uploads, search fields, and other input types, all styled automatically without additional classes.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ The `<input type="color">` renders a native color picker widget.
|
|
|
18
18
|
|
|
19
19
|
## Date & time inputs
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
µCSS styles all native date and time input types consistently.
|
|
22
22
|
|
|
23
23
|
```html
|
|
24
24
|
<label>Date
|
|
@@ -88,7 +88,7 @@ Wrap a search input and button inside a `<div role="search">` for a grouped sear
|
|
|
88
88
|
|
|
89
89
|
## Other input types
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
µCSS styles several additional input types natively.
|
|
92
92
|
|
|
93
93
|
```html
|
|
94
94
|
<label>Number
|
|
@@ -161,4 +161,6 @@ Use `aria-invalid` to indicate validation state visually. Add a `<small>` elemen
|
|
|
161
161
|
|
|
162
162
|
---
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
> See also : [µForms](mu.forms.md) · [µGroup](mu.group.md)
|
|
165
|
+
|
|
166
|
+
→ [See example](../examples/forms-advanced.html)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# µForms
|
|
2
2
|
|
|
3
|
-
**µForms**
|
|
3
|
+
**µForms** provides form controls with size variants and validation states, part of the [µCSS](.) framework. It applies to `<input>`, `<textarea>`, and `<select>` elements.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Input sizes
|
|
8
8
|
|
|
9
|
-
Two size modifiers adjust padding and font size. Without a size class, the default
|
|
9
|
+
Two size modifiers adjust padding and font size. Without a size class, the default styling applies.
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
12
|
<label>Small input
|
|
@@ -25,7 +25,7 @@ Two size modifiers adjust padding and font size. Without a size class, the defau
|
|
|
25
25
|
| Class | Padding | Font size | Applies to |
|
|
26
26
|
|-------------|--------------------------|---------------|----------------------------------|
|
|
27
27
|
| `.input-sm` | `0.375rem 0.625rem` | `0.8125rem` | `input`, `textarea`, `select` |
|
|
28
|
-
| *(default)* | *(
|
|
28
|
+
| *(default)* | *(default)* | *(default)* | `input`, `textarea`, `select` |
|
|
29
29
|
| `.input-lg` | `0.75rem 1rem` | `1.125rem` | `input`, `textarea`, `select` |
|
|
30
30
|
|
|
31
31
|
### Textarea sizes
|
|
@@ -60,7 +60,7 @@ Two size modifiers adjust padding and font size. Without a size class, the defau
|
|
|
60
60
|
|
|
61
61
|
## Validation states
|
|
62
62
|
|
|
63
|
-
µForms provides two validation classes that set border color and focus ring color. For error states, use the native `aria-invalid="true"` attribute (
|
|
63
|
+
µForms provides two validation classes that set border color and focus ring color. For error states, use the native `aria-invalid="true"` attribute (built-in).
|
|
64
64
|
|
|
65
65
|
```html
|
|
66
66
|
<label>Success
|
|
@@ -78,9 +78,9 @@ Two size modifiers adjust padding and font size. Without a size class, the defau
|
|
|
78
78
|
|
|
79
79
|
| Class / Attribute | Border color | Focus ring color |
|
|
80
80
|
|--------------------------|-----------------------|---------------------------|
|
|
81
|
-
| `.input-success` | `--
|
|
82
|
-
| `.input-warning` | `--
|
|
83
|
-
| `aria-invalid="true"` | *(
|
|
81
|
+
| `.input-success` | `--mu-success` | `--mu-success-focus` |
|
|
82
|
+
| `.input-warning` | `--mu-warning` | `--mu-warning-focus` |
|
|
83
|
+
| `aria-invalid="true"` | *(built-in)* | *(built-in)* |
|
|
84
84
|
|
|
85
85
|
### Validation on textarea
|
|
86
86
|
|
|
@@ -138,10 +138,12 @@ Size and validation classes can be used together on the same element:
|
|
|
138
138
|
|
|
139
139
|
## Accessibility
|
|
140
140
|
|
|
141
|
-
- Use `aria-invalid="true"` for error states (
|
|
141
|
+
- Use `aria-invalid="true"` for error states (native support).
|
|
142
142
|
- Always wrap form controls inside `<label>` elements for proper association.
|
|
143
143
|
- Validation colors supplement, but do not replace, text-based error messages.
|
|
144
144
|
|
|
145
145
|
---
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
> See also : [µForms (advanced)](mu.forms-advanced.md) · [µGroup](mu.group.md) · [µCheckbox & Radio](mu.checkbox-radio.md)
|
|
148
|
+
|
|
149
|
+
→ [See example](../examples/forms.html)
|
package/documentation/mu.grid.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# µGrid
|
|
2
2
|
|
|
3
|
-
**µGrid** is a lightweight flexbox-based 12-column responsive grid system, part of the [µCSS](.) framework. It provides a Bootstrap-compatible grid fallback for CSS frameworks that lack a built-in responsive grid (such as PicoCSS).
|
|
3
|
+
**µGrid** is a lightweight flexbox-based 12-column responsive grid system, part of the [µCSS](.) framework. It provides a Bootstrap-compatible grid fallback for CSS frameworks that lack a built-in responsive grid (such as PicoCSS v2).
|
|
4
4
|
|
|
5
5
|
**Weight:** ~4 KB uncompressed, ~1 KB gzipped.
|
|
6
6
|
|
|
@@ -173,3 +173,9 @@ When showing a `.row` that was previously hidden, use `d-{bp}-flex` instead of `
|
|
|
173
173
|
- **No auto-sizing columns**: `.col` (without a number) is not supported.
|
|
174
174
|
- **No `row-cols-*`**: automatic column count per row is not supported.
|
|
175
175
|
- **No flex alignment utilities**: `justify-content-*`, `align-items-*` are not included.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
> See also : [µContainer](mu.container.md)
|
|
180
|
+
|
|
181
|
+
> [See example](../examples/grid.html)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# µGroup
|
|
2
2
|
|
|
3
|
-
**µGroup**
|
|
3
|
+
**µGroup** allows visually grouping form fields and buttons on a single line, using the `role="group"` attribute styled by [µCSS](.). Grouped elements share common borders and align horizontally.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Button group
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
The `role="group"` attribute on a container groups buttons into a horizontal bar with merged borders.
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
12
|
<div role="group">
|
|
@@ -18,9 +18,9 @@ L'attribut `role="group"` sur un conteneur regroupe les boutons en une barre hor
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
## Input +
|
|
21
|
+
## Input + button
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Combine an input field and a button in the same group to create a compact inline form.
|
|
24
24
|
|
|
25
25
|
```html
|
|
26
26
|
<div role="group">
|
|
@@ -31,9 +31,9 @@ Combinez un champ de saisie et un bouton dans un meme groupe pour creer un formu
|
|
|
31
31
|
|
|
32
32
|
---
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## Search group
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
Use `role="search"` for a group semantically identified as a search area. The visual rendering is identical to `role="group"`.
|
|
37
37
|
|
|
38
38
|
```html
|
|
39
39
|
<div role="search">
|
|
@@ -44,9 +44,9 @@ Utilisez `role="search"` pour un groupe semantiquement identifie comme zone de r
|
|
|
44
44
|
|
|
45
45
|
---
|
|
46
46
|
|
|
47
|
-
## Input + select +
|
|
47
|
+
## Input + select + button
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
A group can contain more than two elements, for example a `<select>`, an `<input>` and a `<button>`.
|
|
50
50
|
|
|
51
51
|
```html
|
|
52
52
|
<div role="group">
|
|
@@ -62,9 +62,9 @@ Un groupe peut contenir plus de deux elements, par exemple un `<select>`, un `<i
|
|
|
62
62
|
|
|
63
63
|
---
|
|
64
64
|
|
|
65
|
-
##
|
|
65
|
+
## Outline buttons
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
`.outline` buttons also work within a group, providing a toggle bar style.
|
|
68
68
|
|
|
69
69
|
```html
|
|
70
70
|
<div role="group">
|
|
@@ -76,27 +76,29 @@ Les boutons `.outline` fonctionnent egalement dans un groupe, offrant un style d
|
|
|
76
76
|
|
|
77
77
|
---
|
|
78
78
|
|
|
79
|
-
##
|
|
79
|
+
## Role summary
|
|
80
80
|
|
|
81
|
-
|
|
|
82
|
-
|
|
83
|
-
| `role="group"` |
|
|
84
|
-
| `role="search"` |
|
|
81
|
+
| Attribute | Usage |
|
|
82
|
+
|-----------|-------|
|
|
83
|
+
| `role="group"` | Generic group (buttons, inputs, selects) |
|
|
84
|
+
| `role="search"` | Search group (semantic) |
|
|
85
85
|
|
|
86
|
-
##
|
|
86
|
+
## Supported elements in a group
|
|
87
87
|
|
|
88
|
-
| Element |
|
|
89
|
-
|
|
90
|
-
| `<button>` |
|
|
91
|
-
| `<input>` |
|
|
92
|
-
| `<select>` |
|
|
88
|
+
| Element | Behavior |
|
|
89
|
+
|---------|----------|
|
|
90
|
+
| `<button>` | Action button |
|
|
91
|
+
| `<input>` | Input field (text, email, search, number, etc.) |
|
|
92
|
+
| `<select>` | Selection list |
|
|
93
93
|
|
|
94
94
|
---
|
|
95
95
|
|
|
96
|
-
##
|
|
96
|
+
## Accessibility
|
|
97
97
|
|
|
98
|
-
- `role="group"`
|
|
99
|
-
- `role="search"`
|
|
100
|
-
-
|
|
98
|
+
- `role="group"` informs assistive technologies that the elements are related and form a logical set.
|
|
99
|
+
- `role="search"` semantically identifies the area as a search feature, which helps screen reader navigation.
|
|
100
|
+
- Elements within the group remain individually accessible via keyboard (`Tab` navigation).
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
> See also : [µForms](mu.forms.md) · [µButton](mu.button.md)
|
|
103
|
+
|
|
104
|
+
> [See example](../examples/group.html)
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# µHero
|
|
2
|
+
|
|
3
|
+
**µHero** is a full-width hero section component, part of the [µCSS](.) framework. It provides 11 color roles with gradient backgrounds, badges, call-to-action buttons, and responsive sizing.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Basic usage
|
|
8
|
+
|
|
9
|
+
Apply `.hero` along with a color variant class to a `<section>`. Use an inner `.container` for content width:
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<section class="hero hero-primary">
|
|
13
|
+
<div class="container">
|
|
14
|
+
<h1>Title</h1>
|
|
15
|
+
<p class="hero-tagline">Tagline text</p>
|
|
16
|
+
</div>
|
|
17
|
+
</section>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The hero must be placed **outside** `<main class="container">` for full-width rendering.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Color variants (11 colors)
|
|
25
|
+
|
|
26
|
+
All 11 color roles are available:
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<section class="hero hero-primary">...</section>
|
|
30
|
+
<section class="hero hero-secondary">...</section>
|
|
31
|
+
<section class="hero hero-tertiary">...</section>
|
|
32
|
+
<section class="hero hero-contrast">...</section>
|
|
33
|
+
<section class="hero hero-success">...</section>
|
|
34
|
+
<section class="hero hero-info">...</section>
|
|
35
|
+
<section class="hero hero-warning">...</section>
|
|
36
|
+
<section class="hero hero-error">...</section>
|
|
37
|
+
<section class="hero hero-accent">...</section>
|
|
38
|
+
<section class="hero hero-pop">...</section>
|
|
39
|
+
<section class="hero hero-spark">...</section>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Each variant defines `--hero-color` and `--hero-text` using the corresponding `--mu-{role}` and `--mu-{role}-inverse` variables (bridge pattern).
|
|
43
|
+
|
|
44
|
+
| Class | Background | Text color |
|
|
45
|
+
|-------|-----------|------------|
|
|
46
|
+
| `.hero-primary` | `--mu-primary` | `--mu-primary-inverse` |
|
|
47
|
+
| `.hero-secondary` | `--mu-secondary` | `--mu-secondary-inverse` |
|
|
48
|
+
| `.hero-tertiary` | `--mu-tertiary` | `--mu-tertiary-inverse` |
|
|
49
|
+
| `.hero-contrast` | `--mu-contrast` | `--mu-contrast-inverse` |
|
|
50
|
+
| `.hero-success` | `--mu-success` | `--mu-success-inverse` |
|
|
51
|
+
| `.hero-info` | `--mu-info` | `--mu-info-inverse` |
|
|
52
|
+
| `.hero-warning` | `--mu-warning` | `--mu-warning-inverse` |
|
|
53
|
+
| `.hero-error` | `--mu-error` | `--mu-error-inverse` |
|
|
54
|
+
| `.hero-accent` | `--mu-accent` | `--mu-accent-inverse` |
|
|
55
|
+
| `.hero-pop` | `--mu-pop` | `--mu-pop-inverse` |
|
|
56
|
+
| `.hero-spark` | `--mu-spark` | `--mu-spark-inverse` |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Full hero
|
|
61
|
+
|
|
62
|
+
A complete hero with title, tagline, subtitle, badges and action buttons:
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<section class="hero hero-primary">
|
|
66
|
+
<div class="container">
|
|
67
|
+
<h1>My Project</h1>
|
|
68
|
+
<p class="hero-tagline">A short description of the project</p>
|
|
69
|
+
<p class="hero-subtitle">Additional details about the project</p>
|
|
70
|
+
<div class="hero-badges">
|
|
71
|
+
<span class="badge badge-pill">Feature 1</span>
|
|
72
|
+
<span class="badge badge-pill">Feature 2</span>
|
|
73
|
+
<span class="badge badge-pill">Feature 3</span>
|
|
74
|
+
</div>
|
|
75
|
+
<div class="hero-actions">
|
|
76
|
+
<a class="btn btn-primary" href="#">Get Started</a>
|
|
77
|
+
<a class="btn btn-secondary" href="#">GitHub</a>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</section>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Tagline and subtitle
|
|
86
|
+
|
|
87
|
+
- `.hero-tagline` — Larger text (1.35rem), opacity 0.9
|
|
88
|
+
- `.hero-subtitle` — Smaller text (1.05rem), opacity 0.75
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Badges
|
|
93
|
+
|
|
94
|
+
Wrap `.badge` elements inside `.hero-badges` for a centered flex row with semi-transparent white background:
|
|
95
|
+
|
|
96
|
+
```html
|
|
97
|
+
<div class="hero-badges">
|
|
98
|
+
<span class="badge badge-pill">Badge 1</span>
|
|
99
|
+
<span class="badge badge-pill">Badge 2</span>
|
|
100
|
+
</div>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Action buttons
|
|
106
|
+
|
|
107
|
+
Wrap `.btn` elements inside `.hero-actions`. Inside a hero, buttons are styled to contrast with the gradient background:
|
|
108
|
+
|
|
109
|
+
- `.btn-primary` — White background, hero color text (inverted)
|
|
110
|
+
- `.btn-secondary` — Semi-transparent white background, inherited text color
|
|
111
|
+
|
|
112
|
+
```html
|
|
113
|
+
<div class="hero-actions">
|
|
114
|
+
<a class="btn btn-primary" href="#">Primary action</a>
|
|
115
|
+
<a class="btn btn-secondary" href="#">Secondary action</a>
|
|
116
|
+
</div>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Flat variant
|
|
122
|
+
|
|
123
|
+
Use `.hero-flat` for a solid background without gradient:
|
|
124
|
+
|
|
125
|
+
```html
|
|
126
|
+
<section class="hero hero-primary hero-flat">
|
|
127
|
+
<div class="container">
|
|
128
|
+
<h1>Flat Hero</h1>
|
|
129
|
+
<p class="hero-tagline">Solid color background</p>
|
|
130
|
+
</div>
|
|
131
|
+
</section>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Left-aligned variant
|
|
137
|
+
|
|
138
|
+
Use `.hero-start` for left-aligned content:
|
|
139
|
+
|
|
140
|
+
```html
|
|
141
|
+
<section class="hero hero-primary hero-start">
|
|
142
|
+
<div class="container">
|
|
143
|
+
<h1>Left-Aligned</h1>
|
|
144
|
+
<p class="hero-tagline">Content aligned to the start</p>
|
|
145
|
+
</div>
|
|
146
|
+
</section>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## CSS classes reference
|
|
152
|
+
|
|
153
|
+
| Class | Description |
|
|
154
|
+
|-------|-------------|
|
|
155
|
+
| `.hero` | Base hero section (centered, padded, gradient background) |
|
|
156
|
+
| `.hero-{color}` | Color variant (`primary`, `secondary`, `tertiary`, `contrast`, `success`, `info`, `warning`, `error`, `accent`, `pop`, `spark`) |
|
|
157
|
+
| `.hero-tagline` | Tagline text (1.35rem, opacity 0.9) |
|
|
158
|
+
| `.hero-subtitle` | Subtitle text (1.05rem, opacity 0.75) |
|
|
159
|
+
| `.hero-badges` | Flex container for badges |
|
|
160
|
+
| `.hero-actions` | Flex container for CTA buttons |
|
|
161
|
+
| `.hero-flat` | Solid background without gradient |
|
|
162
|
+
| `.hero-start` | Left-aligned content |
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Styling details
|
|
167
|
+
|
|
168
|
+
| Property | Value |
|
|
169
|
+
|----------|-------|
|
|
170
|
+
| Padding | `4rem 0 3rem` (default), `3rem 0 2rem` (mobile), `5rem 0 4rem` (desktop) |
|
|
171
|
+
| Gradient | `linear-gradient(135deg, color-mix(in oklch, --hero-color 80%, #000) 0%, color-mix(in oklch, --hero-color 50%, #000) 100%)` |
|
|
172
|
+
| Title size | `3.5rem` (default), `2.5rem` (mobile), `4rem` (desktop) |
|
|
173
|
+
| Badge background | `rgba(255, 255, 255, 0.2)` with `backdrop-filter: blur(4px)` |
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Responsive
|
|
178
|
+
|
|
179
|
+
The hero adapts across three breakpoints:
|
|
180
|
+
|
|
181
|
+
| Breakpoint | Title | Tagline | Padding |
|
|
182
|
+
|------------|-------|---------|---------|
|
|
183
|
+
| < 640px | 2.5rem | 1.15rem | 3rem / 2rem |
|
|
184
|
+
| 640–960px | 3.5rem | 1.35rem | 4rem / 3rem |
|
|
185
|
+
| > 960px | 4rem | 1.5rem | 5rem / 4rem |
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Accessibility
|
|
190
|
+
|
|
191
|
+
- Use semantic `<section>` elements for heroes
|
|
192
|
+
- Use `<h1>` for the main title
|
|
193
|
+
- Action links use `.btn` classes which include `:focus-visible` outlines
|
|
194
|
+
- Color contrast is ensured via `--mu-{role}-inverse` text colors
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
> See also : [µButton](mu.button.md) · [µBadge](mu.badge.md)
|
|
199
|
+
|
|
200
|
+
→ [See example](../examples/hero.html)
|