@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,108 @@
|
|
|
1
|
+
# µLink
|
|
2
|
+
|
|
3
|
+
**µLink** describes the styling of hyperlinks (`<a>`) in [µCSS](.). Links use the theme's primary color with an animated underline, and support color variants.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
A standard link uses the `<a>` tag without any additional class:
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<a href="#">Lien standard</a>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The link is displayed in `--mu-primary` color with a semi-transparent underline. On hover, the color darkens and the underline intensifies.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Color variants
|
|
20
|
+
|
|
21
|
+
Three variants are available via CSS classes:
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<a href="#">Lien primaire (defaut)</a>
|
|
25
|
+
<a href="#" class="secondary">Lien secondaire</a>
|
|
26
|
+
<a href="#" class="contrast">Lien contraste</a>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
| Class | Color | Hover |
|
|
30
|
+
|-------|-------|-------|
|
|
31
|
+
| *(default)* | `--mu-primary` | `--mu-primary-hover` |
|
|
32
|
+
| `.secondary` | `--mu-secondary` | `--mu-secondary-hover` |
|
|
33
|
+
| `.contrast` | `--mu-contrast` | `--mu-contrast-hover` |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## States
|
|
38
|
+
|
|
39
|
+
Links support several visual states:
|
|
40
|
+
|
|
41
|
+
| State | Trigger | Effect |
|
|
42
|
+
|-------|---------|--------|
|
|
43
|
+
| Rest | — | Primary color, transparent underline |
|
|
44
|
+
| Hover | `:hover` | Darker color, solid underline |
|
|
45
|
+
| Active | `:active` | Same style as hover |
|
|
46
|
+
| Focus | `:focus` | Same style as hover |
|
|
47
|
+
| Focus visible | `:focus-visible` | Focus ring (`box-shadow`) |
|
|
48
|
+
| Current | `aria-current` | Same style as hover |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Link as button
|
|
53
|
+
|
|
54
|
+
A link can be styled as a button with `role="button"`:
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<a href="#" role="button">Action</a>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The link then adopts the appearance of a button (see [µButton](mu.button.md)).
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## `aria-current` attribute
|
|
65
|
+
|
|
66
|
+
Use `aria-current` to indicate the active page in a navigation:
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<nav>
|
|
70
|
+
<ul>
|
|
71
|
+
<li><a href="/" aria-current="page">Accueil</a></li>
|
|
72
|
+
<li><a href="/about">A propos</a></li>
|
|
73
|
+
</ul>
|
|
74
|
+
</nav>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The link with `aria-current` (except `aria-current="false"`) permanently receives the hover style.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Underline
|
|
82
|
+
|
|
83
|
+
The underline is managed via `text-decoration-color` for a subtle rendering:
|
|
84
|
+
|
|
85
|
+
- **Rest**: underline with reduced opacity (`--mu-primary-underline`)
|
|
86
|
+
- **Hover**: solid underline (`--mu-primary-hover-underline`)
|
|
87
|
+
- **Offset**: `text-underline-offset: 0.125em`
|
|
88
|
+
|
|
89
|
+
To disable the underline globally:
|
|
90
|
+
|
|
91
|
+
```css
|
|
92
|
+
a {
|
|
93
|
+
--mu-text-decoration: none;
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Accessibility
|
|
100
|
+
|
|
101
|
+
- Links must have descriptive text or an `aria-label` for screen readers.
|
|
102
|
+
- The focus ring (`:focus-visible`) is visible for keyboard navigation.
|
|
103
|
+
- The color transition uses `var(--mu-transition)` (0.2s) for smooth visual feedback.
|
|
104
|
+
- Avoid links without `href`; use `<button>` or `role="link"` with a keyboard handler.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
> See also : [µButton](mu.button.md) · [µNav](mu.nav.md) · [µTypography](mu.typography.md)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# µLoading
|
|
2
2
|
|
|
3
|
-
**µLoading** describes the loading indicator states available natively in [µCSS](.)
|
|
3
|
+
**µLoading** describes the loading indicator states available natively in [µCSS](.). Loading states are activated using the standard `aria-busy="true"` attribute on any element, which displays an animated spinner without requiring any additional CSS class or JavaScript library.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -96,4 +96,6 @@ Any element that accepts `aria-busy` can display the loading indicator.
|
|
|
96
96
|
|
|
97
97
|
---
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
> See also : [µSpinner](mu.spinner.md) · [µSkeleton](mu.skeleton.md)
|
|
100
|
+
|
|
101
|
+
→ [See example](../examples/loading.html)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# µModal
|
|
2
2
|
|
|
3
|
-
**µModal** provides size variants and a close button for native `<dialog>` modals, part of the [µCSS](.) framework. It
|
|
3
|
+
**µModal** provides size variants and a close button for native `<dialog>` modals, part of the [µCSS](.) framework. It provides dialog styling with small, large, and fullscreen options.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -30,12 +30,12 @@ Modals use the native HTML `<dialog>` element containing an `<article>`. Open wi
|
|
|
30
30
|
|
|
31
31
|
## Size variants
|
|
32
32
|
|
|
33
|
-
4 sizes are available. Without a size class, the default
|
|
33
|
+
4 sizes are available. Without a size class, the default dialog width applies.
|
|
34
34
|
|
|
35
35
|
| Class | Max-width | Description |
|
|
36
36
|
|---------------------|--------------|--------------------------------------|
|
|
37
37
|
| `.modal-sm` | 400px | Confirmations and simple prompts |
|
|
38
|
-
| *(default)* | *(
|
|
38
|
+
| *(default)* | *(default)* | Suitable for most content |
|
|
39
39
|
| `.modal-lg` | 900px | Forms or detailed content |
|
|
40
40
|
| `.modal-fullscreen` | 100vw | Full viewport, no border-radius |
|
|
41
41
|
|
|
@@ -51,7 +51,7 @@ Size classes are applied on the `<dialog>` element, not on the inner `<article>`
|
|
|
51
51
|
<h3>Small modal</h3>
|
|
52
52
|
<p>This is a small modal (max-width: 400px). Ideal for confirmations and simple prompts.</p>
|
|
53
53
|
<footer>
|
|
54
|
-
<button class="btn btn-
|
|
54
|
+
<button class="btn btn-outline btn-secondary"
|
|
55
55
|
onclick="document.getElementById('modal-sm').close()">Cancel</button>
|
|
56
56
|
<button class="btn btn-primary"
|
|
57
57
|
onclick="document.getElementById('modal-sm').close()">Confirm</button>
|
|
@@ -79,7 +79,7 @@ Size classes are applied on the `<dialog>` element, not on the inner `<article>`
|
|
|
79
79
|
</div>
|
|
80
80
|
<label>Email <input type="email" placeholder="Email address"></label>
|
|
81
81
|
<footer>
|
|
82
|
-
<button class="btn btn-
|
|
82
|
+
<button class="btn btn-outline btn-secondary"
|
|
83
83
|
onclick="document.getElementById('modal-lg').close()">Cancel</button>
|
|
84
84
|
<button class="btn btn-success"
|
|
85
85
|
onclick="document.getElementById('modal-lg').close()">Save</button>
|
|
@@ -124,7 +124,7 @@ The `.modal-close` class styles a close button positioned absolutely in the top-
|
|
|
124
124
|
| Position | Absolute, top-right corner |
|
|
125
125
|
| Size | 3rem x 3rem |
|
|
126
126
|
| Background | Transparent |
|
|
127
|
-
| Color | `--
|
|
127
|
+
| Color | `--mu-secondary` |
|
|
128
128
|
| Opacity | 0.6 (1 on hover) |
|
|
129
129
|
| Focus indicator | 2px solid outline, 0.25rem radius |
|
|
130
130
|
|
|
@@ -160,4 +160,6 @@ Modals rely on the native `<dialog>` API. No JavaScript is bundled with µCSS --
|
|
|
160
160
|
|
|
161
161
|
---
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
> See also : [µButton](mu.button.md)
|
|
164
|
+
|
|
165
|
+
→ [See example](../examples/modal.html)
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# µNav
|
|
2
|
+
|
|
3
|
+
**µNav** provides the responsive navigation bar via the `<nav>` element in [µCSS](.). The navigation uses flexbox to distribute items, with automatic spacing and link styling. On mobile (< 640px), links collapse into a ☰ burger menu via a CSS-only checkbox hack.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
A basic responsive navigation uses `<nav>` with a brand `<ul>`, a hidden checkbox, a burger label, and a `<ul class="navbar-menu">` for the links:
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<nav>
|
|
13
|
+
<ul><li><strong>Mon site</strong></li></ul>
|
|
14
|
+
<input type="checkbox" id="my-nav" class="navbar-toggle" hidden>
|
|
15
|
+
<label for="my-nav" class="navbar-burger">☰</label>
|
|
16
|
+
<ul class="navbar-menu">
|
|
17
|
+
<li><a href="#">Accueil</a></li>
|
|
18
|
+
<li><a href="#">A propos</a></li>
|
|
19
|
+
<li><a href="#">Contact</a></li>
|
|
20
|
+
</ul>
|
|
21
|
+
</nav>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
On desktop, the burger is hidden and links display inline (flex row). On mobile, the burger appears and links are hidden until the user clicks ☰. Each burger needs a unique `id`/`for` pair.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Navigation in a header
|
|
29
|
+
|
|
30
|
+
Place `<nav>` inside a `<header>` with a `.container` for a full-width navigation bar:
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<header>
|
|
34
|
+
<nav class="container">
|
|
35
|
+
<ul><li><strong>µCSS</strong></li></ul>
|
|
36
|
+
<input type="checkbox" id="header-nav" class="navbar-toggle" hidden>
|
|
37
|
+
<label for="header-nav" class="navbar-burger">☰</label>
|
|
38
|
+
<ul class="navbar-menu">
|
|
39
|
+
<li><a href="#">Docs</a></li>
|
|
40
|
+
<li><a href="#">Exemples</a></li>
|
|
41
|
+
<li><a href="#" role="button">Telecharger</a></li>
|
|
42
|
+
</ul>
|
|
43
|
+
</nav>
|
|
44
|
+
</header>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Links and buttons in nav
|
|
50
|
+
|
|
51
|
+
All links inside `<nav>` have no underline (including on hover), whether in the brand area or in `.navbar-menu`. Buttons integrate automatically:
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<nav>
|
|
55
|
+
<ul><li><strong>App</strong></li></ul>
|
|
56
|
+
<input type="checkbox" id="nav-app" class="navbar-toggle" hidden>
|
|
57
|
+
<label for="nav-app" class="navbar-burger">☰</label>
|
|
58
|
+
<ul class="navbar-menu">
|
|
59
|
+
<li><a href="#">Lien</a></li>
|
|
60
|
+
<li><a href="#" role="button">Bouton</a></li>
|
|
61
|
+
</ul>
|
|
62
|
+
</nav>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Customization variables
|
|
68
|
+
|
|
69
|
+
| Variable | Default | Description |
|
|
70
|
+
|----------|---------|-------------|
|
|
71
|
+
| `--mu-nav-element-spacing-vertical` | `1rem` | Vertical padding of items |
|
|
72
|
+
| `--mu-nav-element-spacing-horizontal` | `0.5rem` | Horizontal padding of items |
|
|
73
|
+
| `--mu-nav-link-spacing-vertical` | `0.5rem` | Vertical padding of links |
|
|
74
|
+
| `--mu-nav-link-spacing-horizontal` | `0.5rem` | Horizontal padding of links |
|
|
75
|
+
| `--mu-nav-breadcrumb-divider` | `">"` | Breadcrumb separator |
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Dropdown in nav
|
|
80
|
+
|
|
81
|
+
A dropdown menu can be integrated inside the `.navbar-menu` via `<details class="dropdown">`:
|
|
82
|
+
|
|
83
|
+
```html
|
|
84
|
+
<nav>
|
|
85
|
+
<ul><li><strong>App</strong></li></ul>
|
|
86
|
+
<input type="checkbox" id="nav-dd" class="navbar-toggle" hidden>
|
|
87
|
+
<label for="nav-dd" class="navbar-burger">☰</label>
|
|
88
|
+
<ul class="navbar-menu">
|
|
89
|
+
<li><a href="#">Accueil</a></li>
|
|
90
|
+
<li>
|
|
91
|
+
<details class="dropdown">
|
|
92
|
+
<summary>Menu</summary>
|
|
93
|
+
<ul>
|
|
94
|
+
<li><a href="#">Option 1</a></li>
|
|
95
|
+
<li><a href="#">Option 2</a></li>
|
|
96
|
+
</ul>
|
|
97
|
+
</details>
|
|
98
|
+
</li>
|
|
99
|
+
</ul>
|
|
100
|
+
</nav>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Colored navbars
|
|
106
|
+
|
|
107
|
+
Use `.bg-{role}` on the `<nav>` or on a parent element (e.g. `<header>`) — a gradient (same as [µHero](mu.hero.md)) is applied automatically, and text/links switch to inverse (light) color.
|
|
108
|
+
|
|
109
|
+
Directly on `<nav>`:
|
|
110
|
+
|
|
111
|
+
```html
|
|
112
|
+
<nav class="bg-primary">
|
|
113
|
+
<ul><li><strong>Brand</strong></li></ul>
|
|
114
|
+
<input type="checkbox" id="nav-color" class="navbar-toggle" hidden>
|
|
115
|
+
<label for="nav-color" class="navbar-burger">☰</label>
|
|
116
|
+
<ul class="navbar-menu">
|
|
117
|
+
<li><a href="#">Accueil</a></li>
|
|
118
|
+
<li><a href="#">Contact</a></li>
|
|
119
|
+
</ul>
|
|
120
|
+
</nav>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
For a full-width colored bar with a contained nav, place `.bg-{role}` on the parent `<header>`:
|
|
124
|
+
|
|
125
|
+
```html
|
|
126
|
+
<header class="bg-primary">
|
|
127
|
+
<nav class="container">
|
|
128
|
+
<ul><li><strong>Brand</strong></li></ul>
|
|
129
|
+
<input type="checkbox" id="nav-full" class="navbar-toggle" hidden>
|
|
130
|
+
<label for="nav-full" class="navbar-burger">☰</label>
|
|
131
|
+
<ul class="navbar-menu">
|
|
132
|
+
<li><a href="#">Accueil</a></li>
|
|
133
|
+
<li><a href="#">Contact</a></li>
|
|
134
|
+
</ul>
|
|
135
|
+
</nav>
|
|
136
|
+
</header>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
The gradient uses `color-mix(in oklch)` to darken the role color, ensuring good contrast with white text. On mobile, the dropdown uses standard dropdown colors (not the navbar background), so links remain readable.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Active link
|
|
144
|
+
|
|
145
|
+
Add `.active` to a link to bold it, indicating the current page:
|
|
146
|
+
|
|
147
|
+
```html
|
|
148
|
+
<ul class="navbar-menu">
|
|
149
|
+
<li><a href="#" class="active">Accueil</a></li>
|
|
150
|
+
<li><a href="#">A propos</a></li>
|
|
151
|
+
<li><a href="#">Contact</a></li>
|
|
152
|
+
</ul>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Sticky and fixed navbars
|
|
158
|
+
|
|
159
|
+
Use the utility classes `.sticky-top`, `.fixed-top`, or `.fixed-bottom` on a `<nav>`. When used on a nav, a `z-index` and `box-shadow` are added automatically:
|
|
160
|
+
|
|
161
|
+
```html
|
|
162
|
+
<nav class="sticky-top">
|
|
163
|
+
<ul><li><strong>Brand</strong></li></ul>
|
|
164
|
+
<input type="checkbox" id="nav-s" class="navbar-toggle" hidden>
|
|
165
|
+
<label for="nav-s" class="navbar-burger">☰</label>
|
|
166
|
+
<ul class="navbar-menu">
|
|
167
|
+
<li><a href="#" class="active">Accueil</a></li>
|
|
168
|
+
<li><a href="#">Contact</a></li>
|
|
169
|
+
</ul>
|
|
170
|
+
</nav>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
- `.sticky-top` — stays in flow, sticks to the top on scroll (recommended for navbars)
|
|
174
|
+
- `.fixed-top` — always fixed to the viewport top (content flows behind, add `padding-top` on body)
|
|
175
|
+
- `.fixed-bottom` — fixed to the viewport bottom (useful for mobile action bars)
|
|
176
|
+
|
|
177
|
+
These classes are generic utilities defined in `mu.utilities.css` and work on any element (e.g., sticky `<thead>`, sticky sidebar). See [µUtilities](mu.utilities.md).
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Accessibility
|
|
182
|
+
|
|
183
|
+
- Use `<nav>` as a landmark element for the main navigation.
|
|
184
|
+
- Add `aria-label` to distinguish multiple `<nav>` elements on the same page (e.g., `aria-label="Navigation principale"`).
|
|
185
|
+
- Links in the nav are keyboard-accessible with visible focus (outline + border-radius).
|
|
186
|
+
- For production use, add `aria-label="Menu"` to the burger label and manage `aria-expanded` via JavaScript.
|
|
187
|
+
- For breadcrumbs, use `aria-label="breadcrumb"` on the `<nav>` (see [µBreadcrumb](mu.breadcrumb.md)).
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
> See also : [µBreadcrumb](mu.breadcrumb.md) · [µDropdown](mu.dropdown.md) · [µContainer](mu.container.md)
|
|
@@ -193,4 +193,6 @@ On mobile (<640px), only `.pagination-prev`, `.pagination-next`, and `.active` i
|
|
|
193
193
|
|
|
194
194
|
---
|
|
195
195
|
|
|
196
|
-
|
|
196
|
+
> See also : [µNav](mu.nav.md) · [µBreadcrumb](mu.breadcrumb.md)
|
|
197
|
+
|
|
198
|
+
→ [See example](../examples/pagination.html)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# µProgress
|
|
2
2
|
|
|
3
|
-
**µProgress** adds
|
|
3
|
+
**µProgress** adds 11 color variants to the native `<progress>` element, part of the [µCSS](.) framework. It uses `accent-color` and vendor-specific pseudo-elements for cross-browser compatibility.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Usage
|
|
8
8
|
|
|
9
|
-
Apply a color class directly on a `<progress>` element to change the bar color. Without a color class, the default
|
|
9
|
+
Apply a color class directly on a `<progress>` element to change the bar color. Without a color class, the default progress styling applies.
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
12
|
<progress class="progress-primary" value="75" max="100">75%</progress>
|
|
@@ -18,20 +18,23 @@ The text content inside `<progress>` serves as a fallback for browsers that do n
|
|
|
18
18
|
|
|
19
19
|
## Color variants
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
11 color classes are available, matching the µCSS color roles:
|
|
22
22
|
|
|
23
23
|
| Class | Color variable |
|
|
24
24
|
|----------------------|----------------------|
|
|
25
|
-
| `.progress-primary` | `--
|
|
26
|
-
| `.progress-secondary`| `--
|
|
27
|
-
| `.progress-tertiary` | `--
|
|
28
|
-
| `.progress-contrast` | `--
|
|
29
|
-
| `.progress-
|
|
30
|
-
| `.progress-
|
|
31
|
-
| `.progress-
|
|
32
|
-
| `.progress-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
| `.progress-primary` | `--mu-primary` |
|
|
26
|
+
| `.progress-secondary`| `--mu-secondary` |
|
|
27
|
+
| `.progress-tertiary` | `--mu-tertiary` |
|
|
28
|
+
| `.progress-contrast` | `--mu-contrast` |
|
|
29
|
+
| `.progress-accent` | `--mu-accent` |
|
|
30
|
+
| `.progress-success` | `--mu-success` |
|
|
31
|
+
| `.progress-info` | `--mu-info` |
|
|
32
|
+
| `.progress-warning` | `--mu-warning` |
|
|
33
|
+
| `.progress-error` | `--mu-error` |
|
|
34
|
+
| `.progress-pop` | `--mu-pop` |
|
|
35
|
+
| `.progress-spark` | `--mu-spark` |
|
|
36
|
+
|
|
37
|
+
### All 11 variants
|
|
35
38
|
|
|
36
39
|
```html
|
|
37
40
|
<label>Primary (75%)
|
|
@@ -58,6 +61,15 @@ The text content inside `<progress>` serves as a fallback for browsers that do n
|
|
|
58
61
|
<label>Error (20%)
|
|
59
62
|
<progress class="progress-error" value="20" max="100">20%</progress>
|
|
60
63
|
</label>
|
|
64
|
+
<label>Accent (70%)
|
|
65
|
+
<progress class="progress-accent" value="70" max="100">70%</progress>
|
|
66
|
+
</label>
|
|
67
|
+
<label>Pop (55%)
|
|
68
|
+
<progress class="progress-pop" value="55" max="100">55%</progress>
|
|
69
|
+
</label>
|
|
70
|
+
<label>Spark (40%)
|
|
71
|
+
<progress class="progress-spark" value="40" max="100">40%</progress>
|
|
72
|
+
</label>
|
|
61
73
|
```
|
|
62
74
|
|
|
63
75
|
---
|
|
@@ -105,10 +117,13 @@ Each color variant sets three properties for full browser support:
|
|
|
105
117
|
| `.progress-secondary`| Secondary color progress bar |
|
|
106
118
|
| `.progress-tertiary` | Tertiary color progress bar |
|
|
107
119
|
| `.progress-contrast` | Contrast color progress bar |
|
|
120
|
+
| `.progress-accent` | Accent color progress bar |
|
|
108
121
|
| `.progress-success` | Success (green) progress bar |
|
|
109
122
|
| `.progress-info` | Info (blue) progress bar |
|
|
110
123
|
| `.progress-warning` | Warning (orange/yellow) progress bar |
|
|
111
124
|
| `.progress-error` | Error (red) progress bar |
|
|
125
|
+
| `.progress-pop` | Pop (lighter accent) progress bar |
|
|
126
|
+
| `.progress-spark` | Spark (lighter contrast) progress bar|
|
|
112
127
|
|
|
113
128
|
---
|
|
114
129
|
|
|
@@ -120,4 +135,6 @@ Each color variant sets three properties for full browser support:
|
|
|
120
135
|
|
|
121
136
|
---
|
|
122
137
|
|
|
123
|
-
|
|
138
|
+
> See also : [µLoading](mu.loading.md) · [µSpinner](mu.spinner.md)
|
|
139
|
+
|
|
140
|
+
→ [See example](../examples/progress.html)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# µRange
|
|
2
2
|
|
|
3
|
-
**µRange** describes the native range slider styling provided by [µCSS](.)
|
|
3
|
+
**µRange** describes the native range slider styling provided by [µCSS](.). Range sliders use the standard `<input type="range">` element, which µCSS styles with a custom track and thumb without any additional classes.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -100,4 +100,6 @@ Range sliders work well inside cards (`<article>`) for settings panels.
|
|
|
100
100
|
|
|
101
101
|
---
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
> See also : [µForms](mu.forms.md)
|
|
104
|
+
|
|
105
|
+
→ [See example](../examples/range.html)
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# µSkeleton
|
|
2
|
+
|
|
3
|
+
**µSkeleton** is a loading placeholder component, part of the [µCSS](.) framework. It displays animated shimmer shapes that mimic the layout of content while it loads, reducing perceived loading time.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Basic usage
|
|
8
|
+
|
|
9
|
+
Apply `.skeleton` along with a shape variant class to a `<div>`:
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<div class="skeleton skeleton-text"></div>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Shapes
|
|
18
|
+
|
|
19
|
+
### Text lines
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<div class="skeleton skeleton-text"></div>
|
|
23
|
+
<div class="skeleton skeleton-text"></div>
|
|
24
|
+
<div class="skeleton skeleton-text"></div>
|
|
25
|
+
<div class="skeleton skeleton-text"></div>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The last `.skeleton-text` automatically shrinks to 75% width for a natural paragraph look.
|
|
29
|
+
|
|
30
|
+
### Title
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<div class="skeleton skeleton-title"></div>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Avatar
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<div class="skeleton skeleton-avatar"></div>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Image
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<div class="skeleton skeleton-image"></div>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Composition
|
|
51
|
+
|
|
52
|
+
Combine shapes to build skeleton layouts that mirror real content:
|
|
53
|
+
|
|
54
|
+
```html
|
|
55
|
+
<article>
|
|
56
|
+
<header>
|
|
57
|
+
<div style="display: flex; align-items: center; gap: 0.75rem;">
|
|
58
|
+
<div class="skeleton skeleton-avatar"></div>
|
|
59
|
+
<div style="flex: 1;">
|
|
60
|
+
<div class="skeleton skeleton-title"></div>
|
|
61
|
+
<div class="skeleton skeleton-text" style="width: 40%;"></div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</header>
|
|
65
|
+
<div class="skeleton skeleton-image"></div>
|
|
66
|
+
<div class="skeleton skeleton-text"></div>
|
|
67
|
+
<div class="skeleton skeleton-text"></div>
|
|
68
|
+
<div class="skeleton skeleton-text"></div>
|
|
69
|
+
</article>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## CSS classes reference
|
|
75
|
+
|
|
76
|
+
| Class | Description |
|
|
77
|
+
|-------|-------------|
|
|
78
|
+
| `.skeleton` | Base class (background, shimmer animation, transparent text) |
|
|
79
|
+
| `.skeleton-text` | Text line — `height: 1em`, last child at 75% width |
|
|
80
|
+
| `.skeleton-title` | Title block — `height: 1.5rem`, `width: 50%` |
|
|
81
|
+
| `.skeleton-avatar` | Circle — `3rem × 3rem`, `border-radius: 50%` |
|
|
82
|
+
| `.skeleton-image` | Image rectangle — `height: 12rem`, `border-radius: 0.5rem` |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Styling details
|
|
87
|
+
|
|
88
|
+
| Property | Value |
|
|
89
|
+
|----------|-------|
|
|
90
|
+
| Background | `var(--mu-secondary-background)` |
|
|
91
|
+
| Animation | `mu-shimmer` — 1.5s ease-in-out infinite |
|
|
92
|
+
| Border radius (base) | `0.25rem` |
|
|
93
|
+
| Text line height | `1em` |
|
|
94
|
+
| Text line spacing | `0.5rem` |
|
|
95
|
+
| Title height | `1.5rem` |
|
|
96
|
+
| Avatar size | `3rem` |
|
|
97
|
+
| Image height | `12rem` |
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Accessibility
|
|
102
|
+
|
|
103
|
+
- Skeleton elements use `pointer-events: none` and `user-select: none` to prevent interaction.
|
|
104
|
+
- Text content inside `.skeleton` is hidden via `color: transparent` — screen readers will still read it if present, which can serve as a loading message.
|
|
105
|
+
- The transition from skeleton to real content is the application's JS responsibility — µCSS provides only the CSS styling and animation.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
> See also : [µLoading](mu.loading.md) · [µSpinner](mu.spinner.md)
|
|
110
|
+
|
|
111
|
+
→ [See example](../examples/skeleton.html)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# µSpinner
|
|
2
2
|
|
|
3
|
-
**µSpinner** is a lightweight CSS loading indicator, part of the [µCSS](.) framework. It provides an animated circular spinner available in
|
|
3
|
+
**µSpinner** is a lightweight CSS loading indicator, part of the [µCSS](.) framework. It provides an animated circular spinner available in 11 color variants and 3 sizes, with no JavaScript required.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -18,31 +18,37 @@ The default spinner uses the primary color and a standard size of 1.5rem.
|
|
|
18
18
|
|
|
19
19
|
## Color variants
|
|
20
20
|
|
|
21
|
-
µSpinner supports the
|
|
21
|
+
µSpinner supports the 11 standard µCSS color roles. Add a color modifier class alongside `.spinner`:
|
|
22
22
|
|
|
23
23
|
```html
|
|
24
24
|
<span class="spinner spinner-primary"></span>
|
|
25
25
|
<span class="spinner spinner-secondary"></span>
|
|
26
26
|
<span class="spinner spinner-tertiary"></span>
|
|
27
27
|
<span class="spinner spinner-contrast"></span>
|
|
28
|
+
<span class="spinner spinner-accent"></span>
|
|
28
29
|
<span class="spinner spinner-success"></span>
|
|
29
30
|
<span class="spinner spinner-info"></span>
|
|
30
31
|
<span class="spinner spinner-warning"></span>
|
|
31
32
|
<span class="spinner spinner-error"></span>
|
|
33
|
+
<span class="spinner spinner-pop"></span>
|
|
34
|
+
<span class="spinner spinner-spark"></span>
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
### Color class reference
|
|
35
38
|
|
|
36
39
|
| Class | Color variable |
|
|
37
40
|
|---------------------|-------------------------|
|
|
38
|
-
| `.spinner-primary` | `--
|
|
39
|
-
| `.spinner-secondary`| `--
|
|
40
|
-
| `.spinner-tertiary` | `--
|
|
41
|
-
| `.spinner-contrast` | `--
|
|
42
|
-
| `.spinner-
|
|
43
|
-
| `.spinner-
|
|
44
|
-
| `.spinner-
|
|
45
|
-
| `.spinner-
|
|
41
|
+
| `.spinner-primary` | `--mu-primary` |
|
|
42
|
+
| `.spinner-secondary`| `--mu-secondary` |
|
|
43
|
+
| `.spinner-tertiary` | `--mu-tertiary` |
|
|
44
|
+
| `.spinner-contrast` | `--mu-contrast` |
|
|
45
|
+
| `.spinner-accent` | `--mu-accent` |
|
|
46
|
+
| `.spinner-success` | `--mu-success` |
|
|
47
|
+
| `.spinner-info` | `--mu-info` |
|
|
48
|
+
| `.spinner-warning` | `--mu-warning` |
|
|
49
|
+
| `.spinner-error` | `--mu-error` |
|
|
50
|
+
| `.spinner-pop` | `--mu-pop` |
|
|
51
|
+
| `.spinner-spark` | `--mu-spark` |
|
|
46
52
|
|
|
47
53
|
---
|
|
48
54
|
|
|
@@ -85,7 +91,7 @@ A common pattern is placing a small spinner inside a disabled button to indicate
|
|
|
85
91
|
|
|
86
92
|
## How it works
|
|
87
93
|
|
|
88
|
-
The spinner is a bordered `inline-block` element with a colored top border and a transparent-ish track (using `--
|
|
94
|
+
The spinner is a bordered `inline-block` element with a colored top border and a transparent-ish track (using `--mu-secondary-background`). It rotates continuously via the `mu-spin` keyframe animation (0.6s linear infinite).
|
|
89
95
|
|
|
90
96
|
---
|
|
91
97
|
|
|
@@ -99,4 +105,6 @@ The spinner is purely visual. For screen readers, pair it with appropriate text
|
|
|
99
105
|
|
|
100
106
|
---
|
|
101
107
|
|
|
102
|
-
|
|
108
|
+
> See also : [µLoading](mu.loading.md) · [µSkeleton](mu.skeleton.md)
|
|
109
|
+
|
|
110
|
+
→ [See example](../examples/spinner.html)
|