@digicreon/mucss 1.0.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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +145 -0
  3. package/dist/mu.amber.css +2 -0
  4. package/dist/mu.azure.css +2 -0
  5. package/dist/mu.blue.css +2 -0
  6. package/dist/mu.css +2 -0
  7. package/dist/mu.cyan.css +2 -0
  8. package/dist/mu.fuchsia.css +2 -0
  9. package/dist/mu.green.css +2 -0
  10. package/dist/mu.grey.css +2 -0
  11. package/dist/mu.indigo.css +2 -0
  12. package/dist/mu.jade.css +2 -0
  13. package/dist/mu.lime.css +2 -0
  14. package/dist/mu.orange.css +2 -0
  15. package/dist/mu.pink.css +2 -0
  16. package/dist/mu.pumpkin.css +2 -0
  17. package/dist/mu.purple.css +2 -0
  18. package/dist/mu.red.css +2 -0
  19. package/dist/mu.sand.css +2 -0
  20. package/dist/mu.slate.css +2 -0
  21. package/dist/mu.violet.css +2 -0
  22. package/dist/mu.yellow.css +2 -0
  23. package/dist/mu.zinc.css +2 -0
  24. package/documentation/mu.accordion.md +119 -0
  25. package/documentation/mu.alert.md +134 -0
  26. package/documentation/mu.badge.md +155 -0
  27. package/documentation/mu.breadcrumb.md +140 -0
  28. package/documentation/mu.button.md +147 -0
  29. package/documentation/mu.card.md +135 -0
  30. package/documentation/mu.checkbox-radio.md +121 -0
  31. package/documentation/mu.dropdown.md +183 -0
  32. package/documentation/mu.forms-advanced.md +164 -0
  33. package/documentation/mu.forms.md +147 -0
  34. package/documentation/mu.grid.md +175 -0
  35. package/documentation/mu.group.md +102 -0
  36. package/documentation/mu.loading.md +99 -0
  37. package/documentation/mu.modal.md +163 -0
  38. package/documentation/mu.pagination.md +196 -0
  39. package/documentation/mu.progress.md +123 -0
  40. package/documentation/mu.range.md +103 -0
  41. package/documentation/mu.spinner.md +102 -0
  42. package/documentation/mu.switch.md +110 -0
  43. package/documentation/mu.table.md +147 -0
  44. package/documentation/mu.tabs.md +164 -0
  45. package/documentation/mu.tooltip.md +98 -0
  46. package/documentation/mu.typography.md +196 -0
  47. package/package.json +31 -0
@@ -0,0 +1,134 @@
1
+ # µAlert
2
+
3
+ **µAlert** is a notification banner component, part of the [µCSS](.) framework. It provides 8 color variants, an optional title, inline links, and a dismissible close button.
4
+
5
+ ---
6
+
7
+ ## Basic usage
8
+
9
+ Apply `.alert` along with a color variant class to a `<div>`:
10
+
11
+ ```html
12
+ <div class="alert alert-info">
13
+ <p>This is an informational alert.</p>
14
+ </div>
15
+ ```
16
+
17
+ ---
18
+
19
+ ## Color variants
20
+
21
+ All 8 color roles are available:
22
+
23
+ ```html
24
+ <div class="alert alert-primary"><p>This is a <strong>primary</strong> alert.</p></div>
25
+ <div class="alert alert-secondary"><p>This is a <strong>secondary</strong> alert.</p></div>
26
+ <div class="alert alert-tertiary"><p>This is a <strong>tertiary</strong> alert.</p></div>
27
+ <div class="alert alert-contrast"><p>This is a <strong>contrast</strong> alert.</p></div>
28
+ <div class="alert alert-success"><p>This is a <strong>success</strong> alert.</p></div>
29
+ <div class="alert alert-info"><p>This is an <strong>info</strong> alert.</p></div>
30
+ <div class="alert alert-warning"><p>This is a <strong>warning</strong> alert.</p></div>
31
+ <div class="alert alert-error"><p>This is an <strong>error</strong> alert.</p></div>
32
+ ```
33
+
34
+ | Class | Text color | Background | Border |
35
+ |-------|-----------|------------|--------|
36
+ | `.alert-primary` | `--pico-primary` | `--pico-primary-background` | `--pico-primary` |
37
+ | `.alert-secondary` | `--pico-secondary` | `--pico-secondary-background` | `--pico-secondary` |
38
+ | `.alert-tertiary` | `--pico-tertiary` | `--pico-tertiary-background` | `--pico-tertiary` |
39
+ | `.alert-contrast` | `--pico-contrast` | `--pico-contrast-background` | `--pico-contrast` |
40
+ | `.alert-success` | `--pico-success` | `--pico-success-background` | `--pico-success` |
41
+ | `.alert-info` | `--pico-info` | `--pico-info-background` | `--pico-info` |
42
+ | `.alert-warning` | `--pico-warning` | `--pico-warning-background` | `--pico-warning` |
43
+ | `.alert-error` | `--pico-error` | `--pico-error-background` | `--pico-error` |
44
+
45
+ ---
46
+
47
+ ## With title
48
+
49
+ Add a `<span class="alert-title">` inside the alert for a bold heading:
50
+
51
+ ```html
52
+ <div class="alert alert-success">
53
+ <span class="alert-title">Operation successful</span>
54
+ <p>Your changes have been saved. You can continue editing or return to the dashboard.</p>
55
+ </div>
56
+
57
+ <div class="alert alert-error">
58
+ <span class="alert-title">Something went wrong</span>
59
+ <p>Unable to process your request. Please try again later.</p>
60
+ </div>
61
+ ```
62
+
63
+ The `.alert-title` is displayed as a block element with `font-weight: 700` and a small bottom margin.
64
+
65
+ ---
66
+
67
+ ## Dismissible alerts
68
+
69
+ Add `.alert-dismissible` to the alert and include a `.alert-close` button:
70
+
71
+ ```html
72
+ <div class="alert alert-info alert-dismissible">
73
+ <span class="alert-title">Heads up!</span>
74
+ <p>This alert can be dismissed with the close button.</p>
75
+ <button class="alert-close" aria-label="Close" onclick="this.parentElement.remove()">&times;</button>
76
+ </div>
77
+
78
+ <div class="alert alert-warning alert-dismissible">
79
+ <p>A simple dismissible warning.</p>
80
+ <button class="alert-close" aria-label="Close" onclick="this.parentElement.remove()">&times;</button>
81
+ </div>
82
+ ```
83
+
84
+ - `.alert-dismissible` adds right padding (`3rem`) to make room for the close button.
85
+ - `.alert-close` is absolutely positioned on the right side of the alert, centered vertically.
86
+ - The close button inherits the alert's text color and transitions opacity on hover (0.6 to 1).
87
+
88
+ ---
89
+
90
+ ## With links
91
+
92
+ Links inside alerts are styled with `font-weight: 600`, inherit the alert color, and have an underline:
93
+
94
+ ```html
95
+ <div class="alert alert-primary">
96
+ <p>Check the <a href="#">documentation</a> for more details.</p>
97
+ </div>
98
+ ```
99
+
100
+ ---
101
+
102
+ ## CSS classes reference
103
+
104
+ | Class | Description |
105
+ |-------|-------------|
106
+ | `.alert` | Base alert container (padding, border-radius, margin-bottom) |
107
+ | `.alert-{color}` | Color variant (`primary`, `secondary`, `tertiary`, `contrast`, `success`, `info`, `warning`, `error`) |
108
+ | `.alert-title` | Bold title block inside the alert |
109
+ | `.alert-dismissible` | Adds right padding for the close button |
110
+ | `.alert-close` | Close button, positioned absolutely at the right |
111
+
112
+ ---
113
+
114
+ ## Styling details
115
+
116
+ | Property | Value |
117
+ |----------|-------|
118
+ | Padding | `0.75rem 1rem` |
119
+ | Border radius | `0.375rem` |
120
+ | Font size | `0.9375rem` |
121
+ | Margin bottom | `1rem` |
122
+ | Close button width | `3rem` |
123
+
124
+ ---
125
+
126
+ ## Accessibility
127
+
128
+ - Use `aria-label="Close"` on the `.alert-close` button so screen readers announce its purpose.
129
+ - The close button has a `:focus-visible` outline (`2px solid currentColor`) for keyboard navigation.
130
+ - The dismiss behavior (removing the element) is handled by application JavaScript -- µCSS provides only the CSS styling.
131
+
132
+ ---
133
+
134
+ → [Voir l'exemple](../examples/alert.html)
@@ -0,0 +1,155 @@
1
+ # µBadge
2
+
3
+ **µBadge** is an inline label and counter component, part of the [µCSS](.) framework. It supports 8 color variants, outline style, pill shape, three sizes, and an attached positioning mode for notification counters.
4
+
5
+ ---
6
+
7
+ ## Basic usage
8
+
9
+ Apply `.badge` along with a color variant class to a `<span>`:
10
+
11
+ ```html
12
+ <span class="badge badge-primary">Primary</span>
13
+ ```
14
+
15
+ The default badge (without a color class) uses `--pico-contrast` as its background color.
16
+
17
+ ---
18
+
19
+ ## Color variants (filled)
20
+
21
+ All 8 color roles are available:
22
+
23
+ ```html
24
+ <span class="badge badge-primary">Primary</span>
25
+ <span class="badge badge-secondary">Secondary</span>
26
+ <span class="badge badge-tertiary">Tertiary</span>
27
+ <span class="badge badge-contrast">Contrast</span>
28
+ <span class="badge badge-success">Success</span>
29
+ <span class="badge badge-info">Info</span>
30
+ <span class="badge badge-warning">Warning</span>
31
+ <span class="badge badge-error">Error</span>
32
+ ```
33
+
34
+ | Class | Background | Text color | Border |
35
+ |-------|-----------|------------|--------|
36
+ | `.badge-primary` | `--pico-primary` | `--pico-primary-inverse` | `--pico-primary` |
37
+ | `.badge-secondary` | `--pico-secondary` | `--pico-secondary-inverse` | `--pico-secondary` |
38
+ | `.badge-tertiary` | `--pico-tertiary` | `--pico-tertiary-inverse` | `--pico-tertiary` |
39
+ | `.badge-contrast` | `--pico-contrast` | `--pico-contrast-inverse` | `--pico-contrast` |
40
+ | `.badge-success` | `--pico-success` | `--pico-success-inverse` | `--pico-success` |
41
+ | `.badge-info` | `--pico-info` | `--pico-info-inverse` | `--pico-info` |
42
+ | `.badge-warning` | `--pico-warning` | `--pico-warning-inverse` | `--pico-warning` |
43
+ | `.badge-error` | `--pico-error` | `--pico-error-inverse` | `--pico-error` |
44
+
45
+ ---
46
+
47
+ ## Outline variant
48
+
49
+ Add `.badge-outline` to remove the background and keep only the border and colored text:
50
+
51
+ ```html
52
+ <span class="badge badge-outline badge-primary">Primary</span>
53
+ <span class="badge badge-outline badge-secondary">Secondary</span>
54
+ <span class="badge badge-outline badge-tertiary">Tertiary</span>
55
+ <span class="badge badge-outline badge-contrast">Contrast</span>
56
+ <span class="badge badge-outline badge-success">Success</span>
57
+ <span class="badge badge-outline badge-info">Info</span>
58
+ <span class="badge badge-outline badge-warning">Warning</span>
59
+ <span class="badge badge-outline badge-error">Error</span>
60
+ ```
61
+
62
+ The `.badge-outline` class sets `background-color: transparent` and changes the text color to match the role color.
63
+
64
+ ---
65
+
66
+ ## Pill shape
67
+
68
+ Add `.badge-pill` for fully rounded corners (useful for counters and short labels):
69
+
70
+ ```html
71
+ <span class="badge badge-primary badge-pill">12</span>
72
+ <span class="badge badge-success badge-pill">99+</span>
73
+ <span class="badge badge-error badge-pill">New</span>
74
+ <span class="badge badge-outline badge-info badge-pill">Beta</span>
75
+ ```
76
+
77
+ ---
78
+
79
+ ## Sizes
80
+
81
+ Three sizes are available:
82
+
83
+ ```html
84
+ <span class="badge badge-primary badge-sm">Small</span>
85
+ <span class="badge badge-primary">Default</span>
86
+ <span class="badge badge-primary badge-lg">Large</span>
87
+ ```
88
+
89
+ | Class | Font size | Padding |
90
+ |-------|-----------|---------|
91
+ | `.badge-sm` | `0.6875rem` | `0.15em 0.4em` |
92
+ | *(default)* | `0.75rem` | `0.2em 0.55em` |
93
+ | `.badge-lg` | `0.875rem` | `0.3em 0.7em` |
94
+
95
+ ---
96
+
97
+ ## Attached (notification counter)
98
+
99
+ Use `.badge-attached` to position a badge as a notification counter on the corner of a parent element. The parent must have `position: relative`:
100
+
101
+ ```html
102
+ <span style="position: relative; display: inline-block; padding: 0.5rem 1rem; border: 1px solid var(--pico-secondary-background); border-radius: 0.375rem;">
103
+ Inbox
104
+ <span class="badge badge-error badge-attached badge-pill">3</span>
105
+ </span>
106
+
107
+ <span style="position: relative; display: inline-block; padding: 0.5rem 1rem; border: 1px solid var(--pico-secondary-background); border-radius: 0.375rem;">
108
+ Notifications
109
+ <span class="badge badge-warning badge-attached badge-pill">12</span>
110
+ </span>
111
+ ```
112
+
113
+ The `.badge-attached` class uses absolute positioning (`top: -0.4em; right: -0.4em`) and a pill border-radius. It has a smaller font size (`0.625rem`) and minimum dimensions of `1.2em`.
114
+
115
+ ---
116
+
117
+ ## As links
118
+
119
+ Badges can be rendered as `<a>` or `<button>` elements for clickable behavior:
120
+
121
+ ```html
122
+ <a class="badge badge-primary" href="#">Clickable</a>
123
+ <a class="badge badge-outline badge-success" href="#">Link badge</a>
124
+ ```
125
+
126
+ Link and button badges remove text-decoration, use a pointer cursor, and reduce opacity to `0.85` on hover.
127
+
128
+ ---
129
+
130
+ ## CSS classes reference
131
+
132
+ | Class | Description |
133
+ |-------|-------------|
134
+ | `.badge` | Base badge (inline-flex, padding, font-size, border-radius) |
135
+ | `.badge-{color}` | Color variant (`primary`, `secondary`, `tertiary`, `contrast`, `success`, `info`, `warning`, `error`) |
136
+ | `.badge-outline` | Transparent background, colored text and border |
137
+ | `.badge-pill` | Fully rounded corners (`border-radius: 50rem`) |
138
+ | `.badge-sm` | Small size |
139
+ | `.badge-lg` | Large size |
140
+ | `.badge-attached` | Absolute positioning for notification counters |
141
+
142
+ ---
143
+
144
+ ## Styling details
145
+
146
+ | Property | Value |
147
+ |----------|-------|
148
+ | Default border radius | `0.25rem` |
149
+ | Font weight | `600` |
150
+ | Line height | `1` |
151
+ | Default font size | `0.75rem` |
152
+
153
+ ---
154
+
155
+ → [Voir l'exemple](../examples/badge.html)
@@ -0,0 +1,140 @@
1
+ # µBreadcrumb
2
+
3
+ **µBreadcrumb** is a navigation trail component, part of the [µCSS](.) framework. It provides multiple separator styles, a boxed variant, and proper ARIA semantics for accessible navigation.
4
+
5
+ ---
6
+
7
+ ## Basic usage
8
+
9
+ Use a `<nav>` with `aria-label="Breadcrumb"` wrapping a `<ul class="breadcrumb">`. The last item represents the current page:
10
+
11
+ ```html
12
+ <nav aria-label="Breadcrumb">
13
+ <ul class="breadcrumb">
14
+ <li><a href="#">Home</a></li>
15
+ <li><a href="#">Products</a></li>
16
+ <li><a href="#">Category</a></li>
17
+ <li aria-current="page">Current Page</li>
18
+ </ul>
19
+ </nav>
20
+ ```
21
+
22
+ The default separator between items is `/`.
23
+
24
+ ---
25
+
26
+ ## Separator styles
27
+
28
+ Three alternative separator styles are available by adding a modifier class to the `<ul>`:
29
+
30
+ ### Arrow separator
31
+
32
+ ```html
33
+ <nav aria-label="Breadcrumb">
34
+ <ul class="breadcrumb breadcrumb-arrow">
35
+ <li><a href="#">Home</a></li>
36
+ <li><a href="#">Library</a></li>
37
+ <li aria-current="page">Article</li>
38
+ </ul>
39
+ </nav>
40
+ ```
41
+
42
+ ### Dot separator
43
+
44
+ ```html
45
+ <nav aria-label="Breadcrumb">
46
+ <ul class="breadcrumb breadcrumb-dot">
47
+ <li><a href="#">Home</a></li>
48
+ <li><a href="#">Settings</a></li>
49
+ <li aria-current="page">Profile</li>
50
+ </ul>
51
+ </nav>
52
+ ```
53
+
54
+ ### Chevron separator
55
+
56
+ ```html
57
+ <nav aria-label="Breadcrumb">
58
+ <ul class="breadcrumb breadcrumb-chevron">
59
+ <li><a href="#">Home</a></li>
60
+ <li><a href="#">Dashboard</a></li>
61
+ <li><a href="#">Reports</a></li>
62
+ <li aria-current="page">Monthly</li>
63
+ </ul>
64
+ </nav>
65
+ ```
66
+
67
+ | Class | Separator character |
68
+ |-------|-------------------|
69
+ | *(default)* | `/` |
70
+ | `.breadcrumb-arrow` | `>` (single right-pointing angle) |
71
+ | `.breadcrumb-dot` | `*` (middle dot) |
72
+ | `.breadcrumb-chevron` | `>>` (double right-pointing angle) |
73
+
74
+ ---
75
+
76
+ ## Boxed variant
77
+
78
+ Add `.breadcrumb-boxed` for a background container with padding and rounded corners:
79
+
80
+ ```html
81
+ <nav aria-label="Breadcrumb">
82
+ <ul class="breadcrumb breadcrumb-boxed">
83
+ <li><a href="#">Home</a></li>
84
+ <li><a href="#">Account</a></li>
85
+ <li aria-current="page">Settings</li>
86
+ </ul>
87
+ </nav>
88
+ ```
89
+
90
+ The boxed variant can be combined with any separator style:
91
+
92
+ ```html
93
+ <nav aria-label="Breadcrumb">
94
+ <ul class="breadcrumb breadcrumb-boxed breadcrumb-arrow">
95
+ <li><a href="#">Home</a></li>
96
+ <li><a href="#">Projects</a></li>
97
+ <li aria-current="page">µCSS</li>
98
+ </ul>
99
+ </nav>
100
+ ```
101
+
102
+ ---
103
+
104
+ ## CSS classes reference
105
+
106
+ | Class | Description |
107
+ |-------|-------------|
108
+ | `.breadcrumb` | Base breadcrumb list (flex, no list-style, font-size 0.875rem) |
109
+ | `.breadcrumb-arrow` | Uses `>` as separator |
110
+ | `.breadcrumb-dot` | Uses `*` as separator |
111
+ | `.breadcrumb-chevron` | Uses `>>` as separator |
112
+ | `.breadcrumb-boxed` | Adds background, padding, and border-radius |
113
+
114
+ ---
115
+
116
+ ## Styling details
117
+
118
+ | Property | Value |
119
+ |----------|-------|
120
+ | Font size | `0.875rem` |
121
+ | Separator margin | `0 0.5rem` |
122
+ | Separator color | `var(--pico-secondary)` at 60% opacity |
123
+ | Link color | `var(--pico-primary)` |
124
+ | Link hover | `var(--pico-primary-hover)` with underline |
125
+ | Current page color | `var(--pico-secondary)` |
126
+ | Boxed padding | `0.5rem 1rem` |
127
+ | Boxed background | `var(--pico-secondary-background)` |
128
+ | Boxed border radius | `0.375rem` |
129
+
130
+ ---
131
+
132
+ ## Accessibility
133
+
134
+ - Wrap the breadcrumb in a `<nav>` element with `aria-label="Breadcrumb"`.
135
+ - Mark the current page item with `aria-current="page"` (no `<a>` tag needed).
136
+ - The last item and items with `aria-current` are automatically styled in the secondary color to indicate the active page.
137
+
138
+ ---
139
+
140
+ → [Voir l'exemple](../examples/breadcrumb.html)
@@ -0,0 +1,147 @@
1
+ # µButton
2
+
3
+ **µButton** is a button component, part of the [µCSS](.) framework. It provides 8 color roles in filled and ghost variants, a link style, three sizes, and works on both `<button>` and `<a>` elements.
4
+
5
+ ---
6
+
7
+ ## Basic usage
8
+
9
+ Apply `.btn` along with a color variant class:
10
+
11
+ ```html
12
+ <button class="btn btn-primary">Primary</button>
13
+ ```
14
+
15
+ The `.btn` class can also be applied to `<a>` elements to render links as buttons:
16
+
17
+ ```html
18
+ <a class="btn btn-primary" href="#">Link as button</a>
19
+ ```
20
+
21
+ ---
22
+
23
+ ## Filled variants (8 colors)
24
+
25
+ All 8 color roles are available as filled buttons:
26
+
27
+ ```html
28
+ <button class="btn btn-primary">Primary</button>
29
+ <button class="btn btn-secondary">Secondary</button>
30
+ <button class="btn btn-tertiary">Tertiary</button>
31
+ <button class="btn btn-contrast">Contrast</button>
32
+ <button class="btn btn-success">Success</button>
33
+ <button class="btn btn-info">Info</button>
34
+ <button class="btn btn-warning">Warning</button>
35
+ <button class="btn btn-error">Error</button>
36
+ ```
37
+
38
+ Each filled button has a solid background, matching border, and an inverse text color. On hover, the background and border shift to the `-hover` variant of the color.
39
+
40
+ | Class | Background | Text color | Hover background |
41
+ |-------|-----------|------------|-----------------|
42
+ | `.btn-primary` | `--pico-primary` | `--pico-primary-inverse` | `--pico-primary-hover` |
43
+ | `.btn-secondary` | `--pico-secondary` | `--pico-secondary-inverse` | `--pico-secondary-hover` |
44
+ | `.btn-tertiary` | `--pico-tertiary` | `--pico-tertiary-inverse` | `--pico-tertiary-hover` |
45
+ | `.btn-contrast` | `--pico-contrast` | `--pico-contrast-inverse` | `--pico-contrast-hover` |
46
+ | `.btn-success` | `--pico-success` | `--pico-success-inverse` | `--pico-success-hover` |
47
+ | `.btn-info` | `--pico-info` | `--pico-info-inverse` | `--pico-info-hover` |
48
+ | `.btn-warning` | `--pico-warning` | `--pico-warning-inverse` | `--pico-warning-hover` |
49
+ | `.btn-error` | `--pico-error` | `--pico-error-inverse` | `--pico-error-hover` |
50
+
51
+ ---
52
+
53
+ ## Ghost variant
54
+
55
+ Add `.btn-ghost` alongside a color class for a transparent background with visible border and colored text:
56
+
57
+ ```html
58
+ <button class="btn btn-ghost btn-primary">Primary</button>
59
+ <button class="btn btn-ghost btn-secondary">Secondary</button>
60
+ <button class="btn btn-ghost btn-tertiary">Tertiary</button>
61
+ <button class="btn btn-ghost btn-contrast">Contrast</button>
62
+ <button class="btn btn-ghost btn-success">Success</button>
63
+ <button class="btn btn-ghost btn-info">Info</button>
64
+ <button class="btn btn-ghost btn-warning">Warning</button>
65
+ <button class="btn btn-ghost btn-error">Error</button>
66
+ ```
67
+
68
+ Ghost buttons have `background-color: transparent`, text color matching the role, and a matching border. On hover, opacity is reduced to `0.8`.
69
+
70
+ ---
71
+
72
+ ## Link style
73
+
74
+ Use `.btn-link` for a button that looks like a text link (no background, no border, underlined):
75
+
76
+ ```html
77
+ <button class="btn btn-link">Link button</button>
78
+ ```
79
+
80
+ The link style uses `--pico-primary` as its text color and `--pico-primary-hover` on hover.
81
+
82
+ ---
83
+
84
+ ## Sizes
85
+
86
+ Three sizes are available:
87
+
88
+ ```html
89
+ <button class="btn btn-primary btn-sm">Small</button>
90
+ <button class="btn btn-primary">Default</button>
91
+ <button class="btn btn-primary btn-lg">Large</button>
92
+ ```
93
+
94
+ | Class | Font size | Padding |
95
+ |-------|-----------|---------|
96
+ | `.btn-sm` | `0.8125rem` | `0.375rem 0.625rem` |
97
+ | *(default)* | `1rem` | `0.5rem 1rem` |
98
+ | `.btn-lg` | `1.125rem` | `0.75rem 1.25rem` |
99
+
100
+ ---
101
+
102
+ ## As links
103
+
104
+ Any `<a>` element can use `.btn` classes to look like a button:
105
+
106
+ ```html
107
+ <a class="btn btn-primary" href="#">Link as button</a>
108
+ <a class="btn btn-ghost btn-success" href="#">Ghost link</a>
109
+ <a class="btn btn-error btn-lg" href="#">Large link</a>
110
+ ```
111
+
112
+ ---
113
+
114
+ ## CSS classes reference
115
+
116
+ | Class | Description |
117
+ |-------|-------------|
118
+ | `.btn` | Base button (inline-flex, padding, font-weight 600, border-radius, transitions) |
119
+ | `.btn-{color}` | Filled color variant (`primary`, `secondary`, `tertiary`, `contrast`, `success`, `info`, `warning`, `error`) |
120
+ | `.btn-ghost` | Transparent background, colored border and text |
121
+ | `.btn-link` | Looks like a text link (transparent, underlined, primary color) |
122
+ | `.btn-sm` | Small size |
123
+ | `.btn-lg` | Large size |
124
+
125
+ ---
126
+
127
+ ## Styling details
128
+
129
+ | Property | Value |
130
+ |----------|-------|
131
+ | Border radius | `0.375rem` |
132
+ | Font weight | `600` |
133
+ | Line height | `1.5` |
134
+ | Gap (for icons) | `0.5em` |
135
+ | Transition | `background-color, border-color, color` at `0.15s ease-in-out` |
136
+
137
+ ---
138
+
139
+ ## Accessibility
140
+
141
+ - Each color variant has a dedicated `:focus-visible` outline using the `--pico-{color}-focus` variable with a `2px` outline offset.
142
+ - The `.btn-link` variant follows link color conventions for consistency with standard anchor styling.
143
+ - Use `<button>` for actions and `<a>` for navigation to maintain proper semantics.
144
+
145
+ ---
146
+
147
+ → [Voir l'exemple](../examples/button.html)