@fpkit/acss 3.6.0 → 3.8.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/libs/{chunk-URBGDUFN.cjs → chunk-75YQDONV.cjs} +3 -3
- package/libs/chunk-AOFQDQVS.cjs +17 -0
- package/libs/chunk-AOFQDQVS.cjs.map +1 -0
- package/libs/{chunk-ZF6Y7W57.js → chunk-G3TFKMWB.js} +2 -2
- package/libs/chunk-Q7OAQLUT.js +10 -0
- package/libs/chunk-Q7OAQLUT.js.map +1 -0
- package/libs/components/checkbox/checkbox.css +1 -0
- package/libs/components/checkbox/checkbox.css.map +1 -0
- package/libs/components/checkbox/checkbox.min.css +3 -0
- package/libs/components/dialog/dialog.cjs +4 -4
- package/libs/components/dialog/dialog.js +2 -2
- package/libs/components/heading/heading.cjs +2 -2
- package/libs/components/heading/heading.d.cts +1 -1
- package/libs/components/heading/heading.d.ts +1 -1
- package/libs/components/heading/heading.js +1 -1
- package/libs/components/title/title.css +1 -0
- package/libs/components/title/title.css.map +1 -0
- package/libs/components/title/title.min.css +3 -0
- package/libs/{heading-7446cb46.d.ts → heading-81eef89a.d.ts} +42 -0
- package/libs/index.cjs +32 -31
- package/libs/index.cjs.map +1 -1
- package/libs/index.css +1 -1
- package/libs/index.css.map +1 -1
- package/libs/index.d.cts +357 -2
- package/libs/index.d.ts +357 -2
- package/libs/index.js +7 -7
- package/libs/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/box/box.stories.tsx +1 -1
- package/src/components/checkbox/README.mdx +263 -0
- package/src/components/checkbox/STYLES.mdx +434 -0
- package/src/components/checkbox/checkbox.scss +432 -0
- package/src/components/checkbox/checkbox.stories.tsx +607 -0
- package/src/components/checkbox/checkbox.test.tsx +535 -0
- package/src/components/checkbox/checkbox.tsx +575 -0
- package/src/components/cluster/cluster.stories.tsx +1 -1
- package/src/components/col/README.mdx +233 -9
- package/src/components/col/STYLES.mdx +1380 -0
- package/src/components/col/col.stories.tsx +1 -1
- package/src/components/form/README.mdx +173 -146
- package/src/components/grid/grid.stories.tsx +130 -35
- package/src/components/row/row.stories.tsx +1 -1
- package/src/components/stack/stack.stories.tsx +219 -60
- package/src/components/title/README.mdx +87 -1
- package/src/components/title/STYLES.mdx +501 -0
- package/src/components/title/title.scss +51 -0
- package/src/components/title/title.stories.tsx +158 -0
- package/src/components/title/title.test.tsx +113 -0
- package/src/components/title/title.tsx +53 -1
- package/src/index.scss +2 -0
- package/src/index.ts +7 -0
- package/src/sass/_columns.scss +13 -9
- package/src/sass/columns.stories.tsx +434 -10
- package/src/styles/checkbox/checkbox.css +372 -0
- package/src/styles/checkbox/checkbox.css.map +1 -0
- package/src/styles/index.css +445 -0
- package/src/styles/index.css.map +1 -1
- package/src/styles/title/title.css +75 -0
- package/src/styles/title/title.css.map +1 -0
- package/libs/chunk-2C3YLBWP.cjs +0 -17
- package/libs/chunk-2C3YLBWP.cjs.map +0 -1
- package/libs/chunk-KDMX3FAW.js +0 -10
- package/libs/chunk-KDMX3FAW.js.map +0 -1
- /package/libs/{chunk-URBGDUFN.cjs.map → chunk-75YQDONV.cjs.map} +0 -0
- /package/libs/{chunk-ZF6Y7W57.js.map → chunk-G3TFKMWB.js.map} +0 -0
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
import { Meta } from "@storybook/addon-docs/blocks";
|
|
2
|
+
|
|
3
|
+
<Meta title="FP.React Forms/Inputs/Checkbox/Styles" />
|
|
4
|
+
|
|
5
|
+
# Checkbox CSS Variables
|
|
6
|
+
|
|
7
|
+
Complete reference for customizing the Checkbox component using CSS custom
|
|
8
|
+
properties.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
The Checkbox component uses CSS custom properties for flexible theming and
|
|
13
|
+
customization. All properties follow the standardized naming convention:
|
|
14
|
+
`--checkbox-{element}-{variant}-{property}`.
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
```css
|
|
19
|
+
/* Global customization */
|
|
20
|
+
:root {
|
|
21
|
+
--checkbox-size: 1.5rem;
|
|
22
|
+
--checkbox-checked-bg: #7c3aed;
|
|
23
|
+
--checkbox-radius: 0.5rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Scoped customization */
|
|
27
|
+
.my-form {
|
|
28
|
+
--checkbox-checked-bg: #10b981;
|
|
29
|
+
--checkbox-focus-outline-color: #86efac;
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
/* Inline customization */
|
|
35
|
+
<Checkbox
|
|
36
|
+
id="custom"
|
|
37
|
+
label="Custom styled"
|
|
38
|
+
styles={{
|
|
39
|
+
"--checkbox-size": "2rem",
|
|
40
|
+
"--checkbox-checked-bg": "#7c3aed",
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Size Tokens
|
|
46
|
+
|
|
47
|
+
Control checkbox dimensions with size tokens:
|
|
48
|
+
|
|
49
|
+
```css
|
|
50
|
+
--checkbox-size-sm: 1rem; /* 16px - Small */
|
|
51
|
+
--checkbox-size-md: 1.25rem; /* 20px - Medium (default) */
|
|
52
|
+
--checkbox-size-lg: 1.5rem; /* 24px - Large */
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Usage:**
|
|
56
|
+
|
|
57
|
+
```css
|
|
58
|
+
[data-checkbox~="sm"] {
|
|
59
|
+
--checkbox-size: var(--checkbox-size-sm);
|
|
60
|
+
}
|
|
61
|
+
[data-checkbox~="md"] {
|
|
62
|
+
--checkbox-size: var(--checkbox-size-md);
|
|
63
|
+
}
|
|
64
|
+
[data-checkbox~="lg"] {
|
|
65
|
+
--checkbox-size: var(--checkbox-size-lg);
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Base Properties
|
|
70
|
+
|
|
71
|
+
Core checkbox styling properties:
|
|
72
|
+
|
|
73
|
+
| Variable | Default | Description |
|
|
74
|
+
| ------------------------- | ---------------------------- | ---------------------------- |
|
|
75
|
+
| `--checkbox-size` | `var(--checkbox-size-md)` | Width and height of checkbox |
|
|
76
|
+
| `--checkbox-bg` | `#ffffff` | Background color (unchecked) |
|
|
77
|
+
| `--checkbox-border` | `0.125rem solid #6b7280` | Border style |
|
|
78
|
+
| `--checkbox-border-color` | `#6b7280` | Border color |
|
|
79
|
+
| `--checkbox-radius` | `0.25rem` | Border radius (4px) |
|
|
80
|
+
| `--checkbox-cursor` | `pointer` | Cursor style |
|
|
81
|
+
| `--checkbox-transition` | `all 0.2s cubic-bezier(...)` | Transition animation |
|
|
82
|
+
|
|
83
|
+
## Checkmark Properties
|
|
84
|
+
|
|
85
|
+
Styling for the checkmark indicator:
|
|
86
|
+
|
|
87
|
+
| Variable | Default | Description |
|
|
88
|
+
| -------------------------------- | ------------ | ---------------------- |
|
|
89
|
+
| `--checkbox-checkmark-color` | `#ffffff` | Checkmark color |
|
|
90
|
+
| `--checkbox-checkmark-opacity` | `0` | Opacity when unchecked |
|
|
91
|
+
| `--checkbox-checkmark-transform` | `scale(0.7)` | Scale when unchecked |
|
|
92
|
+
|
|
93
|
+
## Label Properties
|
|
94
|
+
|
|
95
|
+
Label text styling:
|
|
96
|
+
|
|
97
|
+
| Variable | Default | Description |
|
|
98
|
+
| ------------------------- | --------- | ------------------------------------ |
|
|
99
|
+
| `--checkbox-label-gap` | `0.5rem` | Gap between checkbox and label (8px) |
|
|
100
|
+
| `--checkbox-label-fs` | `1rem` | Label font size (16px) |
|
|
101
|
+
| `--checkbox-label-color` | `inherit` | Label text color |
|
|
102
|
+
| `--checkbox-label-cursor` | `pointer` | Label cursor style |
|
|
103
|
+
| `--checkbox-label-fw` | `400` | Label font weight |
|
|
104
|
+
|
|
105
|
+
## Description Properties
|
|
106
|
+
|
|
107
|
+
Helper text styling:
|
|
108
|
+
|
|
109
|
+
| Variable | Default | Description |
|
|
110
|
+
| --------------------------------------------- | ----------- | --------------------- |
|
|
111
|
+
| `--checkbox-description-fs` | `0.875rem` | Font size (14px) |
|
|
112
|
+
| `--checkbox-description-color` | `#6b7280` | Text color (Gray 500) |
|
|
113
|
+
| `--checkbox-description-margin-block-start` | `0.25rem` | Top margin (4px) |
|
|
114
|
+
| `--checkbox-description-padding-inline-start` | `calc(...)` | Left padding |
|
|
115
|
+
|
|
116
|
+
## Error Message Properties
|
|
117
|
+
|
|
118
|
+
Error text styling:
|
|
119
|
+
|
|
120
|
+
| Variable | Default | Description |
|
|
121
|
+
| --------------------------------------- | ----------- | -------------------- |
|
|
122
|
+
| `--checkbox-error-fs` | `0.875rem` | Font size (14px) |
|
|
123
|
+
| `--checkbox-error-color` | `#dc2626` | Text color (Red 600) |
|
|
124
|
+
| `--checkbox-error-margin-block-start` | `0.25rem` | Top margin (4px) |
|
|
125
|
+
| `--checkbox-error-padding-inline-start` | `calc(...)` | Left padding |
|
|
126
|
+
|
|
127
|
+
## Required Indicator
|
|
128
|
+
|
|
129
|
+
Required asterisk styling:
|
|
130
|
+
|
|
131
|
+
| Variable | Default | Description |
|
|
132
|
+
| --------------------------- | --------- | --------------- |
|
|
133
|
+
| `--checkbox-required-color` | `#dc2626` | Color (Red 600) |
|
|
134
|
+
| `--checkbox-required-fw` | `600` | Font weight |
|
|
135
|
+
|
|
136
|
+
## Color Variants
|
|
137
|
+
|
|
138
|
+
All color variants meet WCAG 2.1 AA contrast requirements (4.5:1 minimum).
|
|
139
|
+
|
|
140
|
+
### Primary (Blue)
|
|
141
|
+
|
|
142
|
+
```css
|
|
143
|
+
--checkbox-primary-checked-bg: #2563eb; /* 4.68:1 contrast */
|
|
144
|
+
--checkbox-primary-checked-border: #2563eb;
|
|
145
|
+
--checkbox-primary-hover-border: #3b82f6;
|
|
146
|
+
--checkbox-primary-focus-outline-color: #93c5fd;
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Secondary (Gray)
|
|
150
|
+
|
|
151
|
+
```css
|
|
152
|
+
--checkbox-secondary-checked-bg: #4b5563; /* 7.56:1 contrast */
|
|
153
|
+
--checkbox-secondary-checked-border: #4b5563;
|
|
154
|
+
--checkbox-secondary-hover-border: #6b7280;
|
|
155
|
+
--checkbox-secondary-focus-outline-color: #9ca3af;
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Error (Red)
|
|
159
|
+
|
|
160
|
+
```css
|
|
161
|
+
--checkbox-error-checked-bg: #dc2626; /* 5.14:1 contrast */
|
|
162
|
+
--checkbox-error-checked-border: #dc2626;
|
|
163
|
+
--checkbox-error-hover-border: #ef4444;
|
|
164
|
+
--checkbox-error-focus-outline-color: #fca5a5;
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Success (Green)
|
|
168
|
+
|
|
169
|
+
```css
|
|
170
|
+
--checkbox-success-checked-bg: #16a34a; /* 4.54:1 contrast */
|
|
171
|
+
--checkbox-success-checked-border: #16a34a;
|
|
172
|
+
--checkbox-success-hover-border: #22c55e;
|
|
173
|
+
--checkbox-success-focus-outline-color: #86efac;
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## State Properties
|
|
177
|
+
|
|
178
|
+
### Hover State
|
|
179
|
+
|
|
180
|
+
```css
|
|
181
|
+
--checkbox-hover-border-color: #9ca3af;
|
|
182
|
+
--checkbox-hover-bg: #f9fafb;
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Focus State
|
|
186
|
+
|
|
187
|
+
```css
|
|
188
|
+
--checkbox-focus-outline: 0.125rem solid;
|
|
189
|
+
--checkbox-focus-outline-offset: 0.125rem;
|
|
190
|
+
--checkbox-focus-outline-color: var(--checkbox-primary-focus-outline-color);
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Checked State
|
|
194
|
+
|
|
195
|
+
```css
|
|
196
|
+
--checkbox-checked-bg: var(--checkbox-primary-checked-bg);
|
|
197
|
+
--checkbox-checked-border: var(--checkbox-primary-checked-border);
|
|
198
|
+
--checkbox-checked-checkmark-opacity: 1;
|
|
199
|
+
--checkbox-checked-checkmark-transform: scale(1);
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Indeterminate State
|
|
203
|
+
|
|
204
|
+
```css
|
|
205
|
+
--checkbox-indeterminate-bg: var(--checkbox-primary-checked-bg);
|
|
206
|
+
--checkbox-indeterminate-border: var(--checkbox-primary-checked-border);
|
|
207
|
+
--checkbox-indeterminate-dash-width: 0.625rem;
|
|
208
|
+
--checkbox-indeterminate-dash-height: 0.125rem;
|
|
209
|
+
--checkbox-indeterminate-dash-opacity: 1;
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Disabled State
|
|
213
|
+
|
|
214
|
+
```css
|
|
215
|
+
--checkbox-disabled-bg: #f3f4f6;
|
|
216
|
+
--checkbox-disabled-border-color: #d1d5db;
|
|
217
|
+
--checkbox-disabled-opacity: 0.6;
|
|
218
|
+
--checkbox-disabled-cursor: not-allowed;
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Invalid State
|
|
222
|
+
|
|
223
|
+
```css
|
|
224
|
+
--checkbox-invalid-border-color: #dc2626;
|
|
225
|
+
--checkbox-invalid-focus-outline-color: #fca5a5;
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Customization Examples
|
|
229
|
+
|
|
230
|
+
### Example 1: Custom Brand Colors
|
|
231
|
+
|
|
232
|
+
```css
|
|
233
|
+
:root {
|
|
234
|
+
/* Purple brand theme */
|
|
235
|
+
--checkbox-checked-bg: #7c3aed;
|
|
236
|
+
--checkbox-checked-border: #7c3aed;
|
|
237
|
+
--checkbox-focus-outline-color: #c4b5fd;
|
|
238
|
+
--checkbox-hover-border-color: #a78bfa;
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Example 2: Larger Touch Targets
|
|
243
|
+
|
|
244
|
+
```css
|
|
245
|
+
.mobile-form {
|
|
246
|
+
/* Increase size for mobile devices */
|
|
247
|
+
--checkbox-size: 1.75rem; /* 28px */
|
|
248
|
+
--checkbox-label-fs: 1.125rem; /* 18px */
|
|
249
|
+
--checkbox-label-gap: 0.75rem; /* 12px */
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Example 3: Rounded/Pill Style
|
|
254
|
+
|
|
255
|
+
```css
|
|
256
|
+
.rounded-checkboxes {
|
|
257
|
+
--checkbox-radius: 100rem; /* Fully rounded */
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Example 4: Shadow Instead of Border
|
|
262
|
+
|
|
263
|
+
```css
|
|
264
|
+
.shadow-checkboxes {
|
|
265
|
+
--checkbox-border: none;
|
|
266
|
+
--checkbox-bg: #f3f4f6;
|
|
267
|
+
--checkbox-checked-bg: #10b981;
|
|
268
|
+
/* Add shadow via inline styles or custom class */
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Example 5: High Contrast Theme
|
|
273
|
+
|
|
274
|
+
```css
|
|
275
|
+
.high-contrast {
|
|
276
|
+
--checkbox-border: 0.1875rem solid #000000; /* 3px black border */
|
|
277
|
+
--checkbox-checked-bg: #000000;
|
|
278
|
+
--checkbox-focus-outline: 0.1875rem solid #000000;
|
|
279
|
+
--checkbox-focus-outline-offset: 0.25rem;
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Example 6: Dark Mode
|
|
284
|
+
|
|
285
|
+
```css
|
|
286
|
+
.dark-theme {
|
|
287
|
+
--checkbox-bg: #1f2937; /* Gray 800 */
|
|
288
|
+
--checkbox-border-color: #4b5563; /* Gray 600 */
|
|
289
|
+
--checkbox-checked-bg: #3b82f6; /* Blue 500 */
|
|
290
|
+
--checkbox-checked-border: #3b82f6;
|
|
291
|
+
--checkbox-label-color: #f3f4f6; /* Gray 100 */
|
|
292
|
+
--checkbox-description-color: #9ca3af; /* Gray 400 */
|
|
293
|
+
--checkbox-hover-bg: #374151; /* Gray 700 */
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Example 7: Minimal Style
|
|
298
|
+
|
|
299
|
+
```css
|
|
300
|
+
.minimal-checkboxes {
|
|
301
|
+
--checkbox-border: 0.0625rem solid #d1d5db; /* 1px thin border */
|
|
302
|
+
--checkbox-radius: 0.125rem; /* 2px small radius */
|
|
303
|
+
--checkbox-checked-bg: #000000;
|
|
304
|
+
--checkbox-transition: none; /* No animation */
|
|
305
|
+
}
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## Complete Variable List
|
|
309
|
+
|
|
310
|
+
Here's every CSS variable available for customization:
|
|
311
|
+
|
|
312
|
+
```css
|
|
313
|
+
/* Size Tokens */
|
|
314
|
+
--checkbox-size-sm
|
|
315
|
+
--checkbox-size-md
|
|
316
|
+
--checkbox-size-lg
|
|
317
|
+
|
|
318
|
+
/* Base Properties */
|
|
319
|
+
--checkbox-size
|
|
320
|
+
--checkbox-bg
|
|
321
|
+
--checkbox-border
|
|
322
|
+
--checkbox-border-color
|
|
323
|
+
--checkbox-radius
|
|
324
|
+
--checkbox-cursor
|
|
325
|
+
--checkbox-transition
|
|
326
|
+
|
|
327
|
+
/* Checkmark */
|
|
328
|
+
--checkbox-checkmark-color
|
|
329
|
+
--checkbox-checkmark-opacity
|
|
330
|
+
--checkbox-checkmark-transform
|
|
331
|
+
|
|
332
|
+
/* Label */
|
|
333
|
+
--checkbox-label-gap
|
|
334
|
+
--checkbox-label-fs
|
|
335
|
+
--checkbox-label-color
|
|
336
|
+
--checkbox-label-cursor
|
|
337
|
+
--checkbox-label-fw
|
|
338
|
+
|
|
339
|
+
/* Description */
|
|
340
|
+
--checkbox-description-fs
|
|
341
|
+
--checkbox-description-color
|
|
342
|
+
--checkbox-description-margin-block-start
|
|
343
|
+
--checkbox-description-padding-inline-start
|
|
344
|
+
|
|
345
|
+
/* Error */
|
|
346
|
+
--checkbox-error-fs
|
|
347
|
+
--checkbox-error-color
|
|
348
|
+
--checkbox-error-margin-block-start
|
|
349
|
+
--checkbox-error-padding-inline-start
|
|
350
|
+
|
|
351
|
+
/* Required */
|
|
352
|
+
--checkbox-required-color
|
|
353
|
+
--checkbox-required-fw
|
|
354
|
+
|
|
355
|
+
/* Primary Variant */
|
|
356
|
+
--checkbox-primary-checked-bg
|
|
357
|
+
--checkbox-primary-checked-border
|
|
358
|
+
--checkbox-primary-hover-border
|
|
359
|
+
--checkbox-primary-focus-outline-color
|
|
360
|
+
|
|
361
|
+
/* Secondary Variant */
|
|
362
|
+
--checkbox-secondary-checked-bg
|
|
363
|
+
--checkbox-secondary-checked-border
|
|
364
|
+
--checkbox-secondary-hover-border
|
|
365
|
+
--checkbox-secondary-focus-outline-color
|
|
366
|
+
|
|
367
|
+
/* Error Variant */
|
|
368
|
+
--checkbox-error-checked-bg
|
|
369
|
+
--checkbox-error-checked-border
|
|
370
|
+
--checkbox-error-hover-border
|
|
371
|
+
--checkbox-error-focus-outline-color
|
|
372
|
+
|
|
373
|
+
/* Success Variant */
|
|
374
|
+
--checkbox-success-checked-bg
|
|
375
|
+
--checkbox-success-checked-border
|
|
376
|
+
--checkbox-success-hover-border
|
|
377
|
+
--checkbox-success-focus-outline-color
|
|
378
|
+
|
|
379
|
+
/* Hover State */
|
|
380
|
+
--checkbox-hover-border-color
|
|
381
|
+
--checkbox-hover-bg
|
|
382
|
+
|
|
383
|
+
/* Focus State */
|
|
384
|
+
--checkbox-focus-outline
|
|
385
|
+
--checkbox-focus-outline-offset
|
|
386
|
+
--checkbox-focus-outline-color
|
|
387
|
+
|
|
388
|
+
/* Checked State */
|
|
389
|
+
--checkbox-checked-bg
|
|
390
|
+
--checkbox-checked-border
|
|
391
|
+
--checkbox-checked-checkmark-opacity
|
|
392
|
+
--checkbox-checked-checkmark-transform
|
|
393
|
+
|
|
394
|
+
/* Indeterminate State */
|
|
395
|
+
--checkbox-indeterminate-bg
|
|
396
|
+
--checkbox-indeterminate-border
|
|
397
|
+
--checkbox-indeterminate-dash-width
|
|
398
|
+
--checkbox-indeterminate-dash-height
|
|
399
|
+
--checkbox-indeterminate-dash-opacity
|
|
400
|
+
|
|
401
|
+
/* Disabled State */
|
|
402
|
+
--checkbox-disabled-bg
|
|
403
|
+
--checkbox-disabled-border-color
|
|
404
|
+
--checkbox-disabled-opacity
|
|
405
|
+
--checkbox-disabled-cursor
|
|
406
|
+
|
|
407
|
+
/* Invalid State */
|
|
408
|
+
--checkbox-invalid-border-color
|
|
409
|
+
--checkbox-invalid-focus-outline-color
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
## Best Practices
|
|
413
|
+
|
|
414
|
+
### ✅ Do
|
|
415
|
+
|
|
416
|
+
- Use CSS custom properties for theming
|
|
417
|
+
- Follow the naming convention when creating new variables
|
|
418
|
+
- Test custom colors for WCAG contrast requirements
|
|
419
|
+
- Use rem units for all size-related properties
|
|
420
|
+
- Scope variables appropriately (:root, class, inline)
|
|
421
|
+
|
|
422
|
+
### ❌ Don't
|
|
423
|
+
|
|
424
|
+
- Use pixel units (use rem instead)
|
|
425
|
+
- Override library source files directly
|
|
426
|
+
- Create one-off variables that don't follow the naming pattern
|
|
427
|
+
- Remove required variables (checkbox will break)
|
|
428
|
+
- Use `!important` unless absolutely necessary
|
|
429
|
+
|
|
430
|
+
## Resources
|
|
431
|
+
|
|
432
|
+
- [CSS Variables Guide](../../docs/css-variables.md)
|
|
433
|
+
- [WCAG Color Contrast Checker](https://webaim.org/resources/contrastchecker/)
|
|
434
|
+
- [Checkbox Component README](./README.mdx)
|