@fpkit/acss 3.1.1 → 3.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/libs/{chunk-2NRIP6RB.cjs → chunk-2C3YLBWP.cjs} +3 -3
- package/libs/{chunk-NWJDAHP6.cjs → chunk-2GJHKWEK.cjs} +3 -3
- package/libs/{chunk-FVROL3V5.js → chunk-2JCDEC32.js} +3 -3
- package/libs/{chunk-IRLFZ3OL.js → chunk-3XJC4XUG.js} +2 -2
- package/libs/{chunk-L6PRDL6F.cjs → chunk-5CJPTDK3.cjs} +3 -3
- package/libs/{chunk-E4OSROCA.cjs → chunk-5QSNJQVH.cjs} +3 -3
- package/libs/{chunk-O3JIHC5M.cjs → chunk-6BUJZ4DJ.cjs} +3 -3
- package/libs/{chunk-WXBFBWYF.cjs → chunk-AFINOD2L.cjs} +3 -3
- package/libs/{chunk-HRRHPLER.js → chunk-AWZLSWDO.js} +2 -2
- package/libs/chunk-DDSXKOUB.js +7 -0
- package/libs/chunk-DDSXKOUB.js.map +1 -0
- package/libs/{chunk-CWRNJA4P.js → chunk-DIJBIOFE.js} +3 -3
- package/libs/chunk-EJ6KYBFE.cjs +13 -0
- package/libs/chunk-EJ6KYBFE.cjs.map +1 -0
- package/libs/{chunk-GUJSMQ3V.cjs → chunk-EKJYOCLY.cjs} +3 -3
- package/libs/{chunk-X5RKCLDC.cjs → chunk-F64GE6RG.cjs} +4 -4
- package/libs/{chunk-5RAWNUVD.js → chunk-IBUTNPTQ.js} +2 -2
- package/libs/chunk-IWP4VJEP.cjs +18 -0
- package/libs/chunk-IWP4VJEP.cjs.map +1 -0
- package/libs/{chunk-ZFJ4U45S.js → chunk-KDMX3FAW.js} +2 -2
- package/libs/{chunk-DYFAUAB7.cjs → chunk-LXODKKA3.cjs} +4 -4
- package/libs/{chunk-MPTMPBFT.js → chunk-M7JLT62Q.js} +2 -2
- package/libs/{chunk-IQ76HGVP.js → chunk-MBWI67UT.js} +2 -2
- package/libs/{chunk-O5XAJ7BY.cjs → chunk-NCGVF2QS.cjs} +4 -4
- package/libs/{chunk-W2UIN7EV.cjs → chunk-NPWHQVYB.cjs} +3 -3
- package/libs/{chunk-43TK2ICH.js → chunk-PMWL5XZ4.js} +3 -3
- package/libs/{chunk-KVKQLRJG.js → chunk-TF3GQKOY.js} +2 -2
- package/libs/{chunk-IEB64SWY.js → chunk-U5VA34SU.js} +2 -2
- package/libs/chunk-UGMP72J2.js +8 -0
- package/libs/chunk-UGMP72J2.js.map +1 -0
- package/libs/{chunk-EE3ZWSBY.cjs → chunk-URBGDUFN.cjs} +6 -6
- package/libs/{chunk-TPIB3RQP.js → chunk-ZF6Y7W57.js} +5 -5
- package/libs/component-props-50e69975.d.ts +66 -0
- package/libs/components/box/box.css +1 -0
- package/libs/components/box/box.css.map +1 -0
- package/libs/components/box/box.min.css +3 -0
- package/libs/components/breadcrumbs/breadcrumb.cjs +6 -6
- package/libs/components/breadcrumbs/breadcrumb.js +3 -3
- package/libs/components/button.cjs +4 -4
- package/libs/components/button.d.cts +10 -3
- package/libs/components/button.d.ts +10 -3
- package/libs/components/button.js +2 -2
- package/libs/components/card.cjs +7 -7
- package/libs/components/card.d.cts +13 -85
- package/libs/components/card.d.ts +13 -85
- package/libs/components/card.js +2 -2
- package/libs/components/cards/card.css +1 -1
- package/libs/components/cards/card.css.map +1 -1
- package/libs/components/cards/card.min.css +2 -2
- package/libs/components/cluster/cluster.css +1 -0
- package/libs/components/cluster/cluster.css.map +1 -0
- package/libs/components/cluster/cluster.min.css +3 -0
- package/libs/components/dialog/dialog.cjs +7 -7
- package/libs/components/dialog/dialog.js +5 -5
- package/libs/components/form/fields.cjs +4 -4
- package/libs/components/form/fields.js +2 -2
- package/libs/components/form/textarea.cjs +4 -4
- package/libs/components/form/textarea.js +2 -2
- package/libs/components/grid/grid.css +1 -0
- package/libs/components/grid/grid.css.map +1 -0
- package/libs/components/grid/grid.min.css +3 -0
- package/libs/components/heading/heading.cjs +3 -3
- package/libs/components/heading/heading.js +2 -2
- package/libs/components/icons/icon.cjs +4 -4
- package/libs/components/icons/icon.d.cts +2 -2
- package/libs/components/icons/icon.d.ts +2 -2
- package/libs/components/icons/icon.js +2 -2
- package/libs/components/link/link.cjs +6 -6
- package/libs/components/link/link.js +2 -2
- package/libs/components/list/list.cjs +5 -5
- package/libs/components/list/list.js +2 -2
- package/libs/components/modal.cjs +4 -4
- package/libs/components/modal.d.cts +1 -1
- package/libs/components/modal.d.ts +1 -1
- package/libs/components/modal.js +3 -3
- package/libs/components/nav/nav.cjs +7 -7
- package/libs/components/nav/nav.js +3 -3
- package/libs/components/stack/stack.css +1 -0
- package/libs/components/stack/stack.css.map +1 -0
- package/libs/components/stack/stack.min.css +3 -0
- package/libs/components/tables/table.d.cts +1 -1
- package/libs/components/tables/table.d.ts +1 -1
- package/libs/components/text/text.cjs +5 -5
- package/libs/components/text/text.js +2 -2
- package/libs/hooks.cjs +4 -4
- package/libs/hooks.js +3 -3
- package/libs/{icons-287fce3a.d.ts → icons-df8e744f.d.ts} +1 -1
- package/libs/icons.cjs +3 -3
- package/libs/icons.d.cts +2 -2
- package/libs/icons.d.ts +2 -2
- package/libs/icons.js +2 -2
- package/libs/index.cjs +64 -63
- 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 +923 -4
- package/libs/index.d.ts +923 -4
- package/libs/index.js +28 -28
- package/libs/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/alert/STYLES.mdx +790 -0
- package/src/components/badge/STYLES.mdx +610 -0
- package/src/components/box/README.mdx +401 -0
- package/src/components/box/STYLES.mdx +360 -0
- package/src/components/box/box.scss +245 -0
- package/src/components/box/box.stories.tsx +395 -0
- package/src/components/box/box.test.tsx +425 -0
- package/src/components/box/box.tsx +170 -0
- package/src/components/box/box.types.ts +166 -0
- package/src/components/breadcrumbs/STYLES.mdx +99 -0
- package/src/components/buttons/STYLES.mdx +766 -0
- package/src/components/cards/STYLES.mdx +835 -0
- package/src/components/cards/card.scss +29 -21
- package/src/components/cards/card.tsx +13 -3
- package/src/components/cards/card.types.ts +13 -0
- package/src/components/cluster/README.mdx +595 -0
- package/src/components/cluster/STYLES.mdx +626 -0
- package/src/components/cluster/cluster.scss +86 -0
- package/src/components/cluster/cluster.stories.tsx +385 -0
- package/src/components/cluster/cluster.test.tsx +655 -0
- package/src/components/cluster/cluster.tsx +94 -0
- package/src/components/cluster/cluster.types.ts +75 -0
- package/src/components/details/STYLES.mdx +445 -0
- package/src/components/dialog/STYLES.mdx +888 -0
- package/src/components/flexbox/STYLES.mdx +1 -1
- package/src/components/form/STYLES.mdx +821 -0
- package/src/components/grid/README.mdx +709 -0
- package/src/components/grid/STYLES.mdx +785 -0
- package/src/components/grid/grid.scss +287 -0
- package/src/components/grid/grid.stories.tsx +486 -0
- package/src/components/grid/grid.test.tsx +981 -0
- package/src/components/grid/grid.tsx +222 -0
- package/src/components/grid/grid.types.ts +344 -0
- package/src/components/icons/STYLES.mdx +56 -0
- package/src/components/images/STYLES.mdx +75 -0
- package/src/components/layout/STYLES.mdx +556 -0
- package/src/components/link/STYLES.mdx +75 -0
- package/src/components/list/STYLES.mdx +631 -0
- package/src/components/nav/STYLES.mdx +460 -0
- package/src/components/progress/STYLES.mdx +64 -0
- package/src/components/stack/README.mdx +400 -0
- package/src/components/stack/STYLES.mdx +414 -0
- package/src/components/stack/stack.scss +109 -0
- package/src/components/stack/stack.stories.tsx +559 -0
- package/src/components/stack/stack.test.tsx +426 -0
- package/src/components/stack/stack.tsx +141 -0
- package/src/components/stack/stack.types.ts +133 -0
- package/src/components/tag/STYLES.mdx +105 -0
- package/src/components/text-to-speech/STYLES.mdx +80 -0
- package/src/components/ui.tsx +3 -3
- package/src/index.scss +5 -1
- package/src/index.ts +305 -12
- package/src/sass/GLOBALS-STYLES.md +631 -0
- package/src/sass/_globals.scss +45 -24
- package/src/styles/box/box.css +220 -0
- package/src/styles/box/box.css.map +1 -0
- package/src/styles/cards/card.css +22 -17
- package/src/styles/cards/card.css.map +1 -1
- package/src/styles/cluster/cluster.css +71 -0
- package/src/styles/cluster/cluster.css.map +1 -0
- package/src/styles/grid/grid.css +238 -0
- package/src/styles/grid/grid.css.map +1 -0
- package/src/styles/index.css +667 -49
- package/src/styles/index.css.map +1 -1
- package/src/styles/stack/stack.css +86 -0
- package/src/styles/stack/stack.css.map +1 -0
- package/src/types/component-props.ts +42 -14
- package/src/types/layout-primitives.ts +48 -0
- package/src/types/shared.ts +10 -26
- package/libs/chunk-ENTCUJ3A.cjs +0 -13
- package/libs/chunk-ENTCUJ3A.cjs.map +0 -1
- package/libs/chunk-HHLNOC5T.js +0 -7
- package/libs/chunk-HHLNOC5T.js.map +0 -1
- package/libs/chunk-KK47SYZI.js +0 -8
- package/libs/chunk-KK47SYZI.js.map +0 -1
- package/libs/chunk-W5TKWBFC.cjs +0 -18
- package/libs/chunk-W5TKWBFC.cjs.map +0 -1
- package/libs/component-props-67d978a2.d.ts +0 -38
- /package/libs/{chunk-2NRIP6RB.cjs.map → chunk-2C3YLBWP.cjs.map} +0 -0
- /package/libs/{chunk-NWJDAHP6.cjs.map → chunk-2GJHKWEK.cjs.map} +0 -0
- /package/libs/{chunk-FVROL3V5.js.map → chunk-2JCDEC32.js.map} +0 -0
- /package/libs/{chunk-IRLFZ3OL.js.map → chunk-3XJC4XUG.js.map} +0 -0
- /package/libs/{chunk-L6PRDL6F.cjs.map → chunk-5CJPTDK3.cjs.map} +0 -0
- /package/libs/{chunk-E4OSROCA.cjs.map → chunk-5QSNJQVH.cjs.map} +0 -0
- /package/libs/{chunk-O3JIHC5M.cjs.map → chunk-6BUJZ4DJ.cjs.map} +0 -0
- /package/libs/{chunk-WXBFBWYF.cjs.map → chunk-AFINOD2L.cjs.map} +0 -0
- /package/libs/{chunk-HRRHPLER.js.map → chunk-AWZLSWDO.js.map} +0 -0
- /package/libs/{chunk-CWRNJA4P.js.map → chunk-DIJBIOFE.js.map} +0 -0
- /package/libs/{chunk-GUJSMQ3V.cjs.map → chunk-EKJYOCLY.cjs.map} +0 -0
- /package/libs/{chunk-X5RKCLDC.cjs.map → chunk-F64GE6RG.cjs.map} +0 -0
- /package/libs/{chunk-5RAWNUVD.js.map → chunk-IBUTNPTQ.js.map} +0 -0
- /package/libs/{chunk-ZFJ4U45S.js.map → chunk-KDMX3FAW.js.map} +0 -0
- /package/libs/{chunk-DYFAUAB7.cjs.map → chunk-LXODKKA3.cjs.map} +0 -0
- /package/libs/{chunk-MPTMPBFT.js.map → chunk-M7JLT62Q.js.map} +0 -0
- /package/libs/{chunk-IQ76HGVP.js.map → chunk-MBWI67UT.js.map} +0 -0
- /package/libs/{chunk-O5XAJ7BY.cjs.map → chunk-NCGVF2QS.cjs.map} +0 -0
- /package/libs/{chunk-W2UIN7EV.cjs.map → chunk-NPWHQVYB.cjs.map} +0 -0
- /package/libs/{chunk-43TK2ICH.js.map → chunk-PMWL5XZ4.js.map} +0 -0
- /package/libs/{chunk-KVKQLRJG.js.map → chunk-TF3GQKOY.js.map} +0 -0
- /package/libs/{chunk-IEB64SWY.js.map → chunk-U5VA34SU.js.map} +0 -0
- /package/libs/{chunk-EE3ZWSBY.cjs.map → chunk-URBGDUFN.cjs.map} +0 -0
- /package/libs/{chunk-TPIB3RQP.js.map → chunk-ZF6Y7W57.js.map} +0 -0
|
@@ -0,0 +1,631 @@
|
|
|
1
|
+
import { Meta } from "@storybook/addon-docs/blocks";
|
|
2
|
+
|
|
3
|
+
<Meta title="FP.REACT Components/List/Styles" />
|
|
4
|
+
|
|
5
|
+
# List Styles
|
|
6
|
+
|
|
7
|
+
Comprehensive list styling system with CSS custom properties for ul, ol, and dl
|
|
8
|
+
elements with extensive variant support.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
The fpkit list styling system provides flexible, accessible list components for
|
|
13
|
+
unordered (`<ul>`), ordered (`<ol>`), and definition (`<dl>`) lists. Includes
|
|
14
|
+
automatic nested list styling, multiple variants, and comprehensive theming.
|
|
15
|
+
|
|
16
|
+
### Key Features
|
|
17
|
+
|
|
18
|
+
- **Three list types** - Unordered, ordered, and definition lists
|
|
19
|
+
- **Nested list support** - Automatic marker changes for nested levels
|
|
20
|
+
- **Five variants** - None, inline, custom, compact, and spaced
|
|
21
|
+
- **Custom markers** - Full control over list markers via CSS variables
|
|
22
|
+
- **Definition lists** - Styled `<dt>`/`<dd>` elements
|
|
23
|
+
- **Print optimized** - Adjusted spacing for print media
|
|
24
|
+
- **Accessibility** - Focus indicators and keyboard navigation support
|
|
25
|
+
- **Rem-based sizing** - All measurements use rem units (1rem = 16px)
|
|
26
|
+
|
|
27
|
+
## CSS Custom Properties
|
|
28
|
+
|
|
29
|
+
### Base List Properties
|
|
30
|
+
|
|
31
|
+
```css
|
|
32
|
+
ul,
|
|
33
|
+
ol,
|
|
34
|
+
dl {
|
|
35
|
+
/* Spacing */
|
|
36
|
+
--list-margin-top: 0;
|
|
37
|
+
--list-margin-bottom: 1rem; /* 16px */
|
|
38
|
+
--list-margin-inline: 0;
|
|
39
|
+
--list-padding-inline: 0.5rem; /* 8px browser indent */
|
|
40
|
+
--list-gap: 0.5rem; /* 8px between items */
|
|
41
|
+
|
|
42
|
+
/* List Markers */
|
|
43
|
+
--list-marker-color: currentColor;
|
|
44
|
+
--list-marker-size: 1em; /* Relative to font size */
|
|
45
|
+
--list-marker-offset: 0.5rem; /* 8px space between marker and text */
|
|
46
|
+
|
|
47
|
+
/* Typography */
|
|
48
|
+
--list-font-size: 1rem; /* 16px */
|
|
49
|
+
--list-line-height: 1.5; /* 24px with 16px font */
|
|
50
|
+
--list-font-family: inherit;
|
|
51
|
+
--list-color: inherit;
|
|
52
|
+
|
|
53
|
+
/* List Item Spacing */
|
|
54
|
+
--list-item-margin-bottom: 0.5rem; /* 8px */
|
|
55
|
+
--list-item-padding-inline: 0;
|
|
56
|
+
--list-item-padding-block: 0;
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Definition List Properties
|
|
61
|
+
|
|
62
|
+
```css
|
|
63
|
+
ul,
|
|
64
|
+
ol,
|
|
65
|
+
dl {
|
|
66
|
+
/* Definition Terms (dt) */
|
|
67
|
+
--dt-font-weight: 600; /* Semi-bold */
|
|
68
|
+
--dt-margin-bottom: 0.25rem; /* 4px */
|
|
69
|
+
|
|
70
|
+
/* Definition Descriptions (dd) */
|
|
71
|
+
--dd-margin-inline-start: 2rem; /* 32px indent */
|
|
72
|
+
--dd-margin-bottom: 1rem; /* 16px */
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Custom Marker Properties
|
|
77
|
+
|
|
78
|
+
```css
|
|
79
|
+
[data-variant="custom"] li::before {
|
|
80
|
+
content: var(--list-marker-content, "•");
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Unordered Lists (ul)
|
|
85
|
+
|
|
86
|
+
### Basic Unordered List
|
|
87
|
+
|
|
88
|
+
```html
|
|
89
|
+
<ul>
|
|
90
|
+
<li>First item</li>
|
|
91
|
+
<li>Second item</li>
|
|
92
|
+
<li>Third item</li>
|
|
93
|
+
</ul>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**CSS Applied:**
|
|
97
|
+
|
|
98
|
+
```css
|
|
99
|
+
ul {
|
|
100
|
+
list-style-type: disc;
|
|
101
|
+
padding-inline-start: 0.5rem;
|
|
102
|
+
margin-block-end: 1rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
ul::marker {
|
|
106
|
+
color: currentColor;
|
|
107
|
+
font-size: 1em;
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Nested Unordered Lists
|
|
112
|
+
|
|
113
|
+
Automatic marker changes for nested levels:
|
|
114
|
+
|
|
115
|
+
```html
|
|
116
|
+
<ul>
|
|
117
|
+
<li>Level 1 (disc ●)</li>
|
|
118
|
+
<li>
|
|
119
|
+
Level 1
|
|
120
|
+
<ul>
|
|
121
|
+
<li>Level 2 (circle ○)</li>
|
|
122
|
+
<li>
|
|
123
|
+
Level 2
|
|
124
|
+
<ul>
|
|
125
|
+
<li>Level 3 (square ■)</li>
|
|
126
|
+
</ul>
|
|
127
|
+
</li>
|
|
128
|
+
</ul>
|
|
129
|
+
</li>
|
|
130
|
+
</ul>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**CSS:**
|
|
134
|
+
|
|
135
|
+
```css
|
|
136
|
+
ul {
|
|
137
|
+
list-style-type: disc;
|
|
138
|
+
}
|
|
139
|
+
ul ul {
|
|
140
|
+
list-style-type: circle;
|
|
141
|
+
}
|
|
142
|
+
ul ul ul {
|
|
143
|
+
list-style-type: square;
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Ordered Lists (ol)
|
|
148
|
+
|
|
149
|
+
### Basic Ordered List
|
|
150
|
+
|
|
151
|
+
```html
|
|
152
|
+
<ol>
|
|
153
|
+
<li>First step</li>
|
|
154
|
+
<li>Second step</li>
|
|
155
|
+
<li>Third step</li>
|
|
156
|
+
</ol>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**CSS:**
|
|
160
|
+
|
|
161
|
+
```css
|
|
162
|
+
ol {
|
|
163
|
+
list-style-type: decimal;
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Nested Ordered Lists
|
|
168
|
+
|
|
169
|
+
Automatic numbering changes for nested levels:
|
|
170
|
+
|
|
171
|
+
```html
|
|
172
|
+
<ol>
|
|
173
|
+
<li>Step 1 (1, 2, 3...)</li>
|
|
174
|
+
<li>
|
|
175
|
+
Step 2
|
|
176
|
+
<ol>
|
|
177
|
+
<li>Substep 2.a (a, b, c...)</li>
|
|
178
|
+
<li>
|
|
179
|
+
Substep 2.b
|
|
180
|
+
<ol>
|
|
181
|
+
<li>Substep 2.b.i (i, ii, iii...)</li>
|
|
182
|
+
</ol>
|
|
183
|
+
</li>
|
|
184
|
+
</ol>
|
|
185
|
+
</li>
|
|
186
|
+
</ol>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**CSS:**
|
|
190
|
+
|
|
191
|
+
```css
|
|
192
|
+
ol {
|
|
193
|
+
list-style-type: decimal;
|
|
194
|
+
}
|
|
195
|
+
ol ol {
|
|
196
|
+
list-style-type: lower-alpha;
|
|
197
|
+
}
|
|
198
|
+
ol ol ol {
|
|
199
|
+
list-style-type: lower-roman;
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Definition Lists (dl)
|
|
204
|
+
|
|
205
|
+
### Basic Definition List
|
|
206
|
+
|
|
207
|
+
```html
|
|
208
|
+
<dl>
|
|
209
|
+
<dt>Term 1</dt>
|
|
210
|
+
<dd>Definition for term 1.</dd>
|
|
211
|
+
|
|
212
|
+
<dt>Term 2</dt>
|
|
213
|
+
<dd>Definition for term 2.</dd>
|
|
214
|
+
</dl>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**CSS:**
|
|
218
|
+
|
|
219
|
+
```css
|
|
220
|
+
dt {
|
|
221
|
+
font-weight: 600;
|
|
222
|
+
margin-block-end: 0.25rem;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
dd {
|
|
226
|
+
margin-inline-start: 2rem; /* Indented */
|
|
227
|
+
margin-block-end: 1rem;
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Multiple Definitions
|
|
232
|
+
|
|
233
|
+
```html
|
|
234
|
+
<dl>
|
|
235
|
+
<dt>Term</dt>
|
|
236
|
+
<dd>First definition</dd>
|
|
237
|
+
<dd>Second definition</dd>
|
|
238
|
+
</dl>
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## List Variants
|
|
242
|
+
|
|
243
|
+
### None Variant
|
|
244
|
+
|
|
245
|
+
Remove list styling:
|
|
246
|
+
|
|
247
|
+
```html
|
|
248
|
+
<ul data-variant="none">
|
|
249
|
+
<li>Item 1</li>
|
|
250
|
+
<li>Item 2</li>
|
|
251
|
+
<li>Item 3</li>
|
|
252
|
+
</ul>
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**CSS:**
|
|
256
|
+
|
|
257
|
+
```css
|
|
258
|
+
[data-variant="none"] {
|
|
259
|
+
list-style-type: none;
|
|
260
|
+
padding-inline-start: 0;
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Inline Variant
|
|
265
|
+
|
|
266
|
+
Horizontal list for navigation:
|
|
267
|
+
|
|
268
|
+
```html
|
|
269
|
+
<ul data-variant="inline">
|
|
270
|
+
<li><a href="/">Home</a></li>
|
|
271
|
+
<li><a href="/about">About</a></li>
|
|
272
|
+
<li><a href="/contact">Contact</a></li>
|
|
273
|
+
</ul>
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**CSS:**
|
|
277
|
+
|
|
278
|
+
```css
|
|
279
|
+
[data-variant="inline"] {
|
|
280
|
+
display: flex;
|
|
281
|
+
flex-direction: row;
|
|
282
|
+
flex-wrap: wrap;
|
|
283
|
+
gap: 0.5rem;
|
|
284
|
+
padding-inline-start: 0;
|
|
285
|
+
list-style-type: none;
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Custom Marker Variant
|
|
290
|
+
|
|
291
|
+
Custom list markers using `::before`:
|
|
292
|
+
|
|
293
|
+
```html
|
|
294
|
+
<ul
|
|
295
|
+
data-variant="custom"
|
|
296
|
+
style="--list-marker-content: '✓'; --list-marker-color: green"
|
|
297
|
+
>
|
|
298
|
+
<li>Completed task</li>
|
|
299
|
+
<li>Another task</li>
|
|
300
|
+
</ul>
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
**CSS:**
|
|
304
|
+
|
|
305
|
+
```css
|
|
306
|
+
[data-variant="custom"] {
|
|
307
|
+
list-style-type: none;
|
|
308
|
+
padding-inline-start: 0;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
[data-variant="custom"] li {
|
|
312
|
+
position: relative;
|
|
313
|
+
padding-inline-start: calc(
|
|
314
|
+
var(--list-marker-size) + var(--list-marker-offset)
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
[data-variant="custom"] li::before {
|
|
319
|
+
content: var(--list-marker-content, "•");
|
|
320
|
+
color: var(--list-marker-color);
|
|
321
|
+
font-size: var(--list-marker-size);
|
|
322
|
+
position: absolute;
|
|
323
|
+
left: 0;
|
|
324
|
+
}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Compact Variant
|
|
328
|
+
|
|
329
|
+
Reduced spacing:
|
|
330
|
+
|
|
331
|
+
```html
|
|
332
|
+
<ul data-variant="compact">
|
|
333
|
+
<li>Compact item 1</li>
|
|
334
|
+
<li>Compact item 2</li>
|
|
335
|
+
<li>Compact item 3</li>
|
|
336
|
+
</ul>
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
**CSS:**
|
|
340
|
+
|
|
341
|
+
```css
|
|
342
|
+
[data-variant="compact"] {
|
|
343
|
+
--list-gap: 0.25rem; /* 4px */
|
|
344
|
+
--list-item-margin-bottom: 0.25rem; /* 4px */
|
|
345
|
+
--list-margin-bottom: 0.5rem; /* 8px */
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### Spaced Variant
|
|
350
|
+
|
|
351
|
+
Increased spacing:
|
|
352
|
+
|
|
353
|
+
```html
|
|
354
|
+
<ul data-variant="spaced">
|
|
355
|
+
<li>Spaced item 1</li>
|
|
356
|
+
<li>Spaced item 2</li>
|
|
357
|
+
<li>Spaced item 3</li>
|
|
358
|
+
</ul>
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
**CSS:**
|
|
362
|
+
|
|
363
|
+
```css
|
|
364
|
+
[data-variant="spaced"] {
|
|
365
|
+
--list-gap: 1rem; /* 16px */
|
|
366
|
+
--list-item-margin-bottom: 1rem; /* 16px */
|
|
367
|
+
}
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
## Real-World Examples
|
|
371
|
+
|
|
372
|
+
### Navigation Menu
|
|
373
|
+
|
|
374
|
+
```html
|
|
375
|
+
<ul data-variant="inline" style="--list-gap: 2rem">
|
|
376
|
+
<li><a href="/">Home</a></li>
|
|
377
|
+
<li><a href="/products">Products</a></li>
|
|
378
|
+
<li><a href="/about">About</a></li>
|
|
379
|
+
<li><a href="/contact">Contact</a></li>
|
|
380
|
+
</ul>
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### Checklist with Custom Markers
|
|
384
|
+
|
|
385
|
+
```html
|
|
386
|
+
<ul
|
|
387
|
+
data-variant="custom"
|
|
388
|
+
style="--list-marker-content: '☐'; --list-marker-size: 1.2em"
|
|
389
|
+
>
|
|
390
|
+
<li>Unchecked task</li>
|
|
391
|
+
<li style="--list-marker-content: '☑'; --list-marker-color: green">
|
|
392
|
+
Completed task
|
|
393
|
+
</li>
|
|
394
|
+
<li>Another task</li>
|
|
395
|
+
</ul>
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### Glossary (Definition List)
|
|
399
|
+
|
|
400
|
+
```html
|
|
401
|
+
<dl>
|
|
402
|
+
<dt>HTML</dt>
|
|
403
|
+
<dd>
|
|
404
|
+
HyperText Markup Language - the standard markup language for web pages.
|
|
405
|
+
</dd>
|
|
406
|
+
|
|
407
|
+
<dt>CSS</dt>
|
|
408
|
+
<dd>
|
|
409
|
+
Cascading Style Sheets - used for describing the presentation of a document.
|
|
410
|
+
</dd>
|
|
411
|
+
|
|
412
|
+
<dt>JavaScript</dt>
|
|
413
|
+
<dd>A programming language that enables interactive web pages.</dd>
|
|
414
|
+
</dl>
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### Step-by-Step Instructions
|
|
418
|
+
|
|
419
|
+
```html
|
|
420
|
+
<ol data-variant="spaced">
|
|
421
|
+
<li>
|
|
422
|
+
<strong>Step 1:</strong> Download the software
|
|
423
|
+
<ul>
|
|
424
|
+
<li>Visit the official website</li>
|
|
425
|
+
<li>Click the download button</li>
|
|
426
|
+
</ul>
|
|
427
|
+
</li>
|
|
428
|
+
<li>
|
|
429
|
+
<strong>Step 2:</strong> Install the application
|
|
430
|
+
<ul>
|
|
431
|
+
<li>Run the installer</li>
|
|
432
|
+
<li>Follow on-screen instructions</li>
|
|
433
|
+
</ul>
|
|
434
|
+
</li>
|
|
435
|
+
<li><strong>Step 3:</strong> Launch and configure</li>
|
|
436
|
+
</ol>
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
### Feature List with Icons
|
|
440
|
+
|
|
441
|
+
```html
|
|
442
|
+
<ul
|
|
443
|
+
data-variant="custom"
|
|
444
|
+
style="--list-marker-content: '✨'; --list-marker-size: 1.5em"
|
|
445
|
+
>
|
|
446
|
+
<li>Fast performance</li>
|
|
447
|
+
<li>Easy to use</li>
|
|
448
|
+
<li>Fully responsive</li>
|
|
449
|
+
<li>Accessible</li>
|
|
450
|
+
</ul>
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### Compact Footer Links
|
|
454
|
+
|
|
455
|
+
```html
|
|
456
|
+
<ul data-variant="inline compact">
|
|
457
|
+
<li><a href="/privacy">Privacy</a></li>
|
|
458
|
+
<li>|</li>
|
|
459
|
+
<li><a href="/terms">Terms</a></li>
|
|
460
|
+
<li>|</li>
|
|
461
|
+
<li><a href="/contact">Contact</a></li>
|
|
462
|
+
</ul>
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
### Nested To-Do List
|
|
466
|
+
|
|
467
|
+
```html
|
|
468
|
+
<ul data-variant="custom" style="--list-marker-content: '☐'">
|
|
469
|
+
<li>
|
|
470
|
+
Project Planning
|
|
471
|
+
<ul data-variant="custom" style="--list-marker-content: '☐'">
|
|
472
|
+
<li style="--list-marker-content: '☑'; --list-marker-color: green">
|
|
473
|
+
Define scope
|
|
474
|
+
</li>
|
|
475
|
+
<li style="--list-marker-content: '☑'; --list-marker-color: green">
|
|
476
|
+
Set timeline
|
|
477
|
+
</li>
|
|
478
|
+
<li>Assign resources</li>
|
|
479
|
+
</ul>
|
|
480
|
+
</li>
|
|
481
|
+
<li>Development</li>
|
|
482
|
+
<li>Testing</li>
|
|
483
|
+
</ul>
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
## Accessibility Considerations
|
|
487
|
+
|
|
488
|
+
### Focus Indicators
|
|
489
|
+
|
|
490
|
+
List items containing links or buttons get subtle focus treatment:
|
|
491
|
+
|
|
492
|
+
```css
|
|
493
|
+
li:has(a:focus-visible),
|
|
494
|
+
li:has(button:focus-visible) {
|
|
495
|
+
outline: 0.0625rem solid transparent;
|
|
496
|
+
}
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
### Semantic Structure
|
|
500
|
+
|
|
501
|
+
Use appropriate list types:
|
|
502
|
+
|
|
503
|
+
- **Unordered lists (`<ul>`)** - Related items without order
|
|
504
|
+
- **Ordered lists (`<ol>`)** - Sequential steps or rankings
|
|
505
|
+
- **Definition lists (`<dl>`)** - Term/definition pairs
|
|
506
|
+
|
|
507
|
+
### Screen Reader Support
|
|
508
|
+
|
|
509
|
+
Lists announce the number of items:
|
|
510
|
+
|
|
511
|
+
```html
|
|
512
|
+
<!-- Screen reader announces: "List, 3 items" -->
|
|
513
|
+
<ul>
|
|
514
|
+
<li>Item 1</li>
|
|
515
|
+
<li>Item 2</li>
|
|
516
|
+
<li>Item 3</li>
|
|
517
|
+
</ul>
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
### Avoid Empty List Items
|
|
521
|
+
|
|
522
|
+
```html
|
|
523
|
+
<!-- Bad: Empty list item -->
|
|
524
|
+
<ul>
|
|
525
|
+
<li></li>
|
|
526
|
+
<li>Item</li>
|
|
527
|
+
</ul>
|
|
528
|
+
|
|
529
|
+
<!-- Good: All items have content -->
|
|
530
|
+
<ul>
|
|
531
|
+
<li>Item 1</li>
|
|
532
|
+
<li>Item 2</li>
|
|
533
|
+
</ul>
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
## Print Styles
|
|
537
|
+
|
|
538
|
+
Lists automatically adjust for print:
|
|
539
|
+
|
|
540
|
+
```css
|
|
541
|
+
@media print {
|
|
542
|
+
ul,
|
|
543
|
+
ol,
|
|
544
|
+
dl {
|
|
545
|
+
--list-margin-bottom: 0.5rem;
|
|
546
|
+
--list-item-margin-bottom: 0.25rem;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
ul,
|
|
550
|
+
ol {
|
|
551
|
+
list-style-position: inside; /* Keeps markers visible */
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
## Reduced Motion
|
|
557
|
+
|
|
558
|
+
Respects user's motion preferences:
|
|
559
|
+
|
|
560
|
+
```css
|
|
561
|
+
@media (prefers-reduced-motion: reduce) {
|
|
562
|
+
ul,
|
|
563
|
+
ol,
|
|
564
|
+
dl,
|
|
565
|
+
li,
|
|
566
|
+
dt,
|
|
567
|
+
dd {
|
|
568
|
+
animation: none;
|
|
569
|
+
transition: none;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
## CSS Variable Naming Convention
|
|
575
|
+
|
|
576
|
+
| Category | Variable Pattern | Example |
|
|
577
|
+
| ---------------- | ------------------------------------ | ---------------------------------------------- |
|
|
578
|
+
| **List Spacing** | `--list-{spacing-type}` | `--list-margin-bottom`, `--list-gap` |
|
|
579
|
+
| **Markers** | `--list-marker-{property}` | `--list-marker-color`, `--list-marker-size` |
|
|
580
|
+
| **Typography** | `--list-{property}` | `--list-font-size`, `--list-line-height` |
|
|
581
|
+
| **List Items** | `--list-item-{property}` | `--list-item-margin-bottom` |
|
|
582
|
+
| **Definition** | `--dt-{property}`, `--dd-{property}` | `--dt-font-weight`, `--dd-margin-inline-start` |
|
|
583
|
+
|
|
584
|
+
## Browser Support
|
|
585
|
+
|
|
586
|
+
- **CSS Custom Properties:** All modern browsers
|
|
587
|
+
- **`::marker` pseudo-element:** Chrome 86+, Firefox 68+, Safari 11.1+
|
|
588
|
+
- **`:has()` selector:** Chrome 105+, Firefox 121+, Safari 15.4+
|
|
589
|
+
- **Logical properties:** Chrome 87+, Firefox 66+, Safari 14.1+
|
|
590
|
+
- **Flexbox (inline variant):** All modern browsers
|
|
591
|
+
|
|
592
|
+
## Performance Tips
|
|
593
|
+
|
|
594
|
+
Create reusable list classes:
|
|
595
|
+
|
|
596
|
+
```css
|
|
597
|
+
.list-navigation {
|
|
598
|
+
--list-gap: 2rem;
|
|
599
|
+
--list-font-size: 1.125rem;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
.list-compact {
|
|
603
|
+
--list-gap: 0.25rem;
|
|
604
|
+
--list-item-margin-bottom: 0.25rem;
|
|
605
|
+
}
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
## Migration from Other Systems
|
|
609
|
+
|
|
610
|
+
### From Tailwind CSS
|
|
611
|
+
|
|
612
|
+
| Tailwind | fpkit List |
|
|
613
|
+
| ------------------------ | ------------------------------------------- |
|
|
614
|
+
| `class="list-none"` | `data-variant="none"` |
|
|
615
|
+
| `class="list-disc"` | Default `<ul>` |
|
|
616
|
+
| `class="space-y-2"` | `style="--list-item-margin-bottom: 0.5rem"` |
|
|
617
|
+
| `class="flex space-x-4"` | `data-variant="inline"` |
|
|
618
|
+
|
|
619
|
+
### From Bootstrap
|
|
620
|
+
|
|
621
|
+
| Bootstrap | fpkit List |
|
|
622
|
+
| ----------------------- | ----------------------- |
|
|
623
|
+
| `class="list-unstyled"` | `data-variant="none"` |
|
|
624
|
+
| `class="list-inline"` | `data-variant="inline"` |
|
|
625
|
+
|
|
626
|
+
## Related Resources
|
|
627
|
+
|
|
628
|
+
- **React Component** - See README for React List component API
|
|
629
|
+
- **MDN: Lists** - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul
|
|
630
|
+
- **W3C: List Structure** -
|
|
631
|
+
https://www.w3.org/WAI/tutorials/page-structure/content/
|