@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,556 @@
|
|
|
1
|
+
import { Meta } from "@storybook/addon-docs/blocks";
|
|
2
|
+
|
|
3
|
+
<Meta title="FP.REACT Components/Layout/Styles" />
|
|
4
|
+
|
|
5
|
+
# Layout Styles
|
|
6
|
+
|
|
7
|
+
Semantic layout component styling system for page structure using HTML5 landmark
|
|
8
|
+
elements (header, main, footer) with CSS custom properties.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
The fpkit layout styling system provides comprehensive styles for semantic page
|
|
13
|
+
structure using HTML5 landmarks. Includes hero/overlay headers, content width
|
|
14
|
+
management, sidebar layouts, and footer styling.
|
|
15
|
+
|
|
16
|
+
### Key Features
|
|
17
|
+
|
|
18
|
+
- **Semantic landmarks** - Header, main, and footer elements with proper
|
|
19
|
+
structure
|
|
20
|
+
- **Hero/overlay system** - Grid-based hero sections with background images
|
|
21
|
+
- **Content width management** - Responsive max-width containers (1480px)
|
|
22
|
+
- **Sidebar layouts** - Article/aside flexbox patterns
|
|
23
|
+
- **Centered content** - Auto-margin centering for main content
|
|
24
|
+
- **CSS custom properties** - Full theming control
|
|
25
|
+
- **Rem-based sizing** - All measurements use rem units (1rem = 16px)
|
|
26
|
+
|
|
27
|
+
## CSS Custom Properties
|
|
28
|
+
|
|
29
|
+
### Header/Hero Overlay Properties
|
|
30
|
+
|
|
31
|
+
```css
|
|
32
|
+
header,
|
|
33
|
+
[data-hero],
|
|
34
|
+
[data-grid~="overlay"] {
|
|
35
|
+
/* Grid */
|
|
36
|
+
--overlay-grid-area: overlay;
|
|
37
|
+
--overlay-display: grid;
|
|
38
|
+
--overlay-placement: center;
|
|
39
|
+
|
|
40
|
+
/* Dimensions */
|
|
41
|
+
--overlay-width: 100%;
|
|
42
|
+
--overlay-height: 40vh; /* 40% of viewport height */
|
|
43
|
+
--overlay-max-height: 500px;
|
|
44
|
+
|
|
45
|
+
/* Content */
|
|
46
|
+
--overlay-content-width: 80%;
|
|
47
|
+
--overlay-gap: 2rem; /* 32px */
|
|
48
|
+
|
|
49
|
+
/* Colors */
|
|
50
|
+
--overlay-bg: whitesmoke;
|
|
51
|
+
--overlay-color: currentColor;
|
|
52
|
+
|
|
53
|
+
/* Spacing */
|
|
54
|
+
--overlay-padding: 2rem; /* 32px */
|
|
55
|
+
--overlay-padding-inline: auto;
|
|
56
|
+
--overlay-padding-block: auto;
|
|
57
|
+
--overlay-margin-inline: auto;
|
|
58
|
+
--overlay-margin-block: auto;
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Main/Footer Content Properties
|
|
63
|
+
|
|
64
|
+
```css
|
|
65
|
+
main,
|
|
66
|
+
footer {
|
|
67
|
+
/* Content width */
|
|
68
|
+
--content-width: min(100%, 1480px); /* Max width with responsive scaling */
|
|
69
|
+
--content-margin-inline: auto; /* Center content */
|
|
70
|
+
--content-padding-inline: 1rem; /* 16px */
|
|
71
|
+
--content-gap: 2rem; /* 32px gap for article/aside */
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Header / Hero Section
|
|
76
|
+
|
|
77
|
+
### Basic Header
|
|
78
|
+
|
|
79
|
+
Simple header with centered content:
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<header>
|
|
83
|
+
<div>
|
|
84
|
+
<h1>Welcome</h1>
|
|
85
|
+
<p>Hero section content</p>
|
|
86
|
+
</div>
|
|
87
|
+
</header>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**CSS Applied:**
|
|
91
|
+
|
|
92
|
+
```css
|
|
93
|
+
header {
|
|
94
|
+
grid-template-areas: "overlay";
|
|
95
|
+
display: grid;
|
|
96
|
+
place-items: center;
|
|
97
|
+
min-height: 40vh;
|
|
98
|
+
width: 100%;
|
|
99
|
+
color: currentColor;
|
|
100
|
+
background-color: whitesmoke;
|
|
101
|
+
min-width: 20rem;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
header > * {
|
|
105
|
+
grid-area: overlay; /* All children in same grid area */
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
header > div {
|
|
109
|
+
max-width: 80%;
|
|
110
|
+
padding-inline: var(--spc-4);
|
|
111
|
+
margin-inline: auto;
|
|
112
|
+
gap: 2rem;
|
|
113
|
+
text-align: center;
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Hero with Background Image
|
|
118
|
+
|
|
119
|
+
Overlay content on background image:
|
|
120
|
+
|
|
121
|
+
```html
|
|
122
|
+
<header style="--overlay-bg: url('/hero.jpg') center/cover">
|
|
123
|
+
<div>
|
|
124
|
+
<h1>Hero Title</h1>
|
|
125
|
+
<p>Hero description text</p>
|
|
126
|
+
<button type="button">Call to Action</button>
|
|
127
|
+
</div>
|
|
128
|
+
</header>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Hero with Data Attribute
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<div
|
|
135
|
+
data-hero
|
|
136
|
+
style="--overlay-height: 60vh; --overlay-bg: #0066cc; --overlay-color: white"
|
|
137
|
+
>
|
|
138
|
+
<div>
|
|
139
|
+
<h1>Product Launch</h1>
|
|
140
|
+
<p>Discover our latest innovation</p>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Hero Grid Overlay
|
|
146
|
+
|
|
147
|
+
```html
|
|
148
|
+
<section data-grid="overlay" style="--overlay-height: 50vh">
|
|
149
|
+
<img src="/background.jpg" alt="" role="presentation" />
|
|
150
|
+
<div>
|
|
151
|
+
<h2>Overlay Content</h2>
|
|
152
|
+
<p>Text overlaid on image</p>
|
|
153
|
+
</div>
|
|
154
|
+
</section>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Hero Typography
|
|
158
|
+
|
|
159
|
+
Headers automatically scale headings:
|
|
160
|
+
|
|
161
|
+
```css
|
|
162
|
+
header > div > h1 {
|
|
163
|
+
font-size: var(--fs-12); /* Large heading */
|
|
164
|
+
line-height: 1.1;
|
|
165
|
+
font-weight: 500;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
header > div > h2 {
|
|
169
|
+
font-size: var(--fs-11);
|
|
170
|
+
line-height: 1.1;
|
|
171
|
+
font-weight: 500;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
header > div > h3 {
|
|
175
|
+
font-size: var(--fs-10);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
header > div p {
|
|
179
|
+
width: auto;
|
|
180
|
+
max-width: 60ch; /* Optimal line length */
|
|
181
|
+
font-size: var(--fs-8);
|
|
182
|
+
line-height: 1.4;
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Main Content
|
|
187
|
+
|
|
188
|
+
### Basic Main Element
|
|
189
|
+
|
|
190
|
+
```html
|
|
191
|
+
<main>
|
|
192
|
+
<section>
|
|
193
|
+
<h2>Page Title</h2>
|
|
194
|
+
<p>Main content goes here.</p>
|
|
195
|
+
</section>
|
|
196
|
+
</main>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**CSS Applied:**
|
|
200
|
+
|
|
201
|
+
```css
|
|
202
|
+
main {
|
|
203
|
+
flex: 1; /* Grows to fill available space */
|
|
204
|
+
font-size: var(--fs-3);
|
|
205
|
+
padding-block: 2rem;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
main > section {
|
|
209
|
+
width: min(100%, 1480px);
|
|
210
|
+
margin-inline: auto;
|
|
211
|
+
padding-inline: var(--spc-6);
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Main with Article
|
|
216
|
+
|
|
217
|
+
```html
|
|
218
|
+
<main>
|
|
219
|
+
<section>
|
|
220
|
+
<article>
|
|
221
|
+
<h2>Article Title</h2>
|
|
222
|
+
<p>Article content...</p>
|
|
223
|
+
</article>
|
|
224
|
+
</section>
|
|
225
|
+
</main>
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Main with Article and Aside (Sidebar Layout)
|
|
229
|
+
|
|
230
|
+
```html
|
|
231
|
+
<main>
|
|
232
|
+
<section>
|
|
233
|
+
<article>
|
|
234
|
+
<h2>Main Content</h2>
|
|
235
|
+
<p>Primary article content...</p>
|
|
236
|
+
</article>
|
|
237
|
+
<aside>
|
|
238
|
+
<h3>Sidebar</h3>
|
|
239
|
+
<p>Sidebar content...</p>
|
|
240
|
+
</aside>
|
|
241
|
+
</section>
|
|
242
|
+
</main>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**CSS Applied:**
|
|
246
|
+
|
|
247
|
+
```css
|
|
248
|
+
main > section:has(> article, > aside) {
|
|
249
|
+
display: flex;
|
|
250
|
+
flex-wrap: wrap;
|
|
251
|
+
flex: 1;
|
|
252
|
+
gap: 2rem;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* Article takes majority of space */
|
|
256
|
+
main > section > article {
|
|
257
|
+
flex-basis: 0;
|
|
258
|
+
flex-grow: 999; /* Grows to fill space */
|
|
259
|
+
min-inline-size: 50%; /* Min 50% width */
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/* Aside (sidebar) with min width */
|
|
263
|
+
main > section > aside {
|
|
264
|
+
flex-basis: 20rem; /* 320px min width */
|
|
265
|
+
flex-grow: 1;
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**Result:** Article takes majority of space; aside wraps below on narrow
|
|
270
|
+
screens.
|
|
271
|
+
|
|
272
|
+
### Main with ARIA Labeled Sections
|
|
273
|
+
|
|
274
|
+
```html
|
|
275
|
+
<main>
|
|
276
|
+
<section aria-label="Introduction">
|
|
277
|
+
<h2>About Us</h2>
|
|
278
|
+
<p>Content...</p>
|
|
279
|
+
</section>
|
|
280
|
+
<section aria-label="Features">
|
|
281
|
+
<h2>Features</h2>
|
|
282
|
+
<p>Content...</p>
|
|
283
|
+
</section>
|
|
284
|
+
</main>
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## Footer
|
|
288
|
+
|
|
289
|
+
### Basic Footer
|
|
290
|
+
|
|
291
|
+
```html
|
|
292
|
+
<footer>
|
|
293
|
+
<div>
|
|
294
|
+
<p>© 2025 Company Name</p>
|
|
295
|
+
</div>
|
|
296
|
+
</footer>
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
**CSS Applied:**
|
|
300
|
+
|
|
301
|
+
```css
|
|
302
|
+
footer {
|
|
303
|
+
padding-block: 2rem;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
footer > section {
|
|
307
|
+
width: min(100%, 1480px);
|
|
308
|
+
margin-inline: auto;
|
|
309
|
+
padding-inline: var(--spc-6);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
footer > div {
|
|
313
|
+
display: flex;
|
|
314
|
+
align-items: center;
|
|
315
|
+
justify-content: center;
|
|
316
|
+
min-height: 5rem; /* 80px */
|
|
317
|
+
text-align: center;
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### Footer with Sections
|
|
322
|
+
|
|
323
|
+
```html
|
|
324
|
+
<footer>
|
|
325
|
+
<section>
|
|
326
|
+
<div>
|
|
327
|
+
<h3>Company</h3>
|
|
328
|
+
<ul>
|
|
329
|
+
<li><a href="/about">About</a></li>
|
|
330
|
+
<li><a href="/careers">Careers</a></li>
|
|
331
|
+
</ul>
|
|
332
|
+
</div>
|
|
333
|
+
<div>
|
|
334
|
+
<h3>Support</h3>
|
|
335
|
+
<ul>
|
|
336
|
+
<li><a href="/help">Help Center</a></li>
|
|
337
|
+
<li><a href="/contact">Contact</a></li>
|
|
338
|
+
</ul>
|
|
339
|
+
</div>
|
|
340
|
+
</section>
|
|
341
|
+
<div>
|
|
342
|
+
<p>© 2025 Company Name</p>
|
|
343
|
+
</div>
|
|
344
|
+
</footer>
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
## Real-World Examples
|
|
348
|
+
|
|
349
|
+
### Full Page Layout
|
|
350
|
+
|
|
351
|
+
```html
|
|
352
|
+
<!doctype html>
|
|
353
|
+
<html lang="en">
|
|
354
|
+
<body>
|
|
355
|
+
<header
|
|
356
|
+
style="--overlay-height: 50vh; --overlay-bg: #0066cc; --overlay-color: white"
|
|
357
|
+
>
|
|
358
|
+
<div>
|
|
359
|
+
<h1>Welcome to Our Site</h1>
|
|
360
|
+
<p>Discover amazing products and services</p>
|
|
361
|
+
<button type="button">Get Started</button>
|
|
362
|
+
</div>
|
|
363
|
+
</header>
|
|
364
|
+
|
|
365
|
+
<main>
|
|
366
|
+
<section>
|
|
367
|
+
<article>
|
|
368
|
+
<h2>Main Content</h2>
|
|
369
|
+
<p>Primary content area...</p>
|
|
370
|
+
</article>
|
|
371
|
+
<aside>
|
|
372
|
+
<h3>Quick Links</h3>
|
|
373
|
+
<ul>
|
|
374
|
+
<li><a href="#">Link 1</a></li>
|
|
375
|
+
<li><a href="#">Link 2</a></li>
|
|
376
|
+
</ul>
|
|
377
|
+
</aside>
|
|
378
|
+
</section>
|
|
379
|
+
</main>
|
|
380
|
+
|
|
381
|
+
<footer>
|
|
382
|
+
<div>
|
|
383
|
+
<p>© 2025 Company Name. All rights reserved.</p>
|
|
384
|
+
</div>
|
|
385
|
+
</footer>
|
|
386
|
+
</body>
|
|
387
|
+
</html>
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
### Hero with Image Overlay
|
|
391
|
+
|
|
392
|
+
```html
|
|
393
|
+
<header>
|
|
394
|
+
<img src="/hero-bg.jpg" alt="" role="presentation" />
|
|
395
|
+
<div style="--overlay-color: white; text-shadow: 0 2px 4px rgba(0,0,0,0.5)">
|
|
396
|
+
<h1>Image Overlay Hero</h1>
|
|
397
|
+
<p>Beautiful background with centered text</p>
|
|
398
|
+
</div>
|
|
399
|
+
</header>
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
### Multi-Column Main
|
|
403
|
+
|
|
404
|
+
```html
|
|
405
|
+
<main>
|
|
406
|
+
<section
|
|
407
|
+
style="display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 2rem"
|
|
408
|
+
>
|
|
409
|
+
<article>
|
|
410
|
+
<h3>Column 1</h3>
|
|
411
|
+
<p>Content...</p>
|
|
412
|
+
</article>
|
|
413
|
+
<article>
|
|
414
|
+
<h3>Column 2</h3>
|
|
415
|
+
<p>Content...</p>
|
|
416
|
+
</article>
|
|
417
|
+
<article>
|
|
418
|
+
<h3>Column 3</h3>
|
|
419
|
+
<p>Content...</p>
|
|
420
|
+
</article>
|
|
421
|
+
</section>
|
|
422
|
+
</main>
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
### Full-Width Hero with Narrow Content
|
|
426
|
+
|
|
427
|
+
```html
|
|
428
|
+
<header style="--overlay-content-width: 50rem">
|
|
429
|
+
<div>
|
|
430
|
+
<h1>Narrow Content Hero</h1>
|
|
431
|
+
<p>Content is constrained to 50rem width</p>
|
|
432
|
+
</div>
|
|
433
|
+
</header>
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
## Accessibility Considerations
|
|
437
|
+
|
|
438
|
+
### Landmark Roles
|
|
439
|
+
|
|
440
|
+
HTML5 landmarks provide automatic ARIA roles:
|
|
441
|
+
|
|
442
|
+
- `<header>` → `role="banner"` (when direct child of body)
|
|
443
|
+
- `<main>` → `role="main"`
|
|
444
|
+
- `<footer>` → `role="contentinfo"` (when direct child of body)
|
|
445
|
+
|
|
446
|
+
### Skip Links
|
|
447
|
+
|
|
448
|
+
Provide skip navigation for keyboard users:
|
|
449
|
+
|
|
450
|
+
```html
|
|
451
|
+
<a href="#main-content" class="skip-link">Skip to main content</a>
|
|
452
|
+
<header>...</header>
|
|
453
|
+
<main id="main-content">...</main>
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
### Heading Hierarchy
|
|
457
|
+
|
|
458
|
+
Maintain proper heading levels:
|
|
459
|
+
|
|
460
|
+
```html
|
|
461
|
+
<header>
|
|
462
|
+
<h1>Site Title</h1>
|
|
463
|
+
</header>
|
|
464
|
+
<main>
|
|
465
|
+
<section>
|
|
466
|
+
<h2>Section Title</h2>
|
|
467
|
+
<h3>Subsection Title</h3>
|
|
468
|
+
</section>
|
|
469
|
+
</main>
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
### Alternative Text for Images
|
|
473
|
+
|
|
474
|
+
Hero background images should use empty alt or role="presentation":
|
|
475
|
+
|
|
476
|
+
```html
|
|
477
|
+
<header>
|
|
478
|
+
<img src="/hero.jpg" alt="" role="presentation" />
|
|
479
|
+
<div>
|
|
480
|
+
<h1>Descriptive Title</h1>
|
|
481
|
+
</div>
|
|
482
|
+
</header>
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
## CSS Variable Naming Convention
|
|
486
|
+
|
|
487
|
+
| Category | Variable Pattern | Example |
|
|
488
|
+
| ----------- | ---------------------- | ---------------------------------- |
|
|
489
|
+
| **Overlay** | `--overlay-{property}` | `--overlay-bg`, `--overlay-height` |
|
|
490
|
+
| **Content** | `--content-{property}` | `--content-width`, `--content-gap` |
|
|
491
|
+
|
|
492
|
+
## Browser Support
|
|
493
|
+
|
|
494
|
+
- **CSS Grid:** All modern browsers
|
|
495
|
+
- **CSS Custom Properties:** All modern browsers
|
|
496
|
+
- **Flexbox:** All modern browsers
|
|
497
|
+
- **`:has()` selector:** Chrome 105+, Firefox 121+, Safari 15.4+
|
|
498
|
+
- **`min()` function:** Chrome 79+, Firefox 75+, Safari 11.1+
|
|
499
|
+
|
|
500
|
+
## Performance Tips
|
|
501
|
+
|
|
502
|
+
### Optimize Hero Images
|
|
503
|
+
|
|
504
|
+
Use responsive images for hero backgrounds:
|
|
505
|
+
|
|
506
|
+
```html
|
|
507
|
+
<header>
|
|
508
|
+
<picture>
|
|
509
|
+
<source srcset="/hero-lg.jpg" media="(min-width: 1024px)" />
|
|
510
|
+
<source srcset="/hero-md.jpg" media="(min-width: 768px)" />
|
|
511
|
+
<img src="/hero-sm.jpg" alt="" role="presentation" />
|
|
512
|
+
</picture>
|
|
513
|
+
<div>
|
|
514
|
+
<h1>Hero Title</h1>
|
|
515
|
+
</div>
|
|
516
|
+
</header>
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
### Use CSS Classes
|
|
520
|
+
|
|
521
|
+
```css
|
|
522
|
+
.hero-dark {
|
|
523
|
+
--overlay-bg: #333;
|
|
524
|
+
--overlay-color: white;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
.hero-tall {
|
|
528
|
+
--overlay-height: 70vh;
|
|
529
|
+
}
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
## Migration from Other Systems
|
|
533
|
+
|
|
534
|
+
### From Tailwind CSS
|
|
535
|
+
|
|
536
|
+
| Tailwind | fpkit Layout |
|
|
537
|
+
| ------------------------------------ | -------------------------------- |
|
|
538
|
+
| `class="container mx-auto"` | `<main>` (automatic) |
|
|
539
|
+
| `class="max-w-7xl mx-auto"` | `style="--content-width: 80rem"` |
|
|
540
|
+
| `class="h-screen flex items-center"` | `<header>` (automatic) |
|
|
541
|
+
|
|
542
|
+
### From Bootstrap
|
|
543
|
+
|
|
544
|
+
| Bootstrap | fpkit Layout |
|
|
545
|
+
| ------------------- | ----------------------------------- |
|
|
546
|
+
| `class="container"` | `<main>` or `<section>` (automatic) |
|
|
547
|
+
| `class="row"` | Article/aside pattern (automatic) |
|
|
548
|
+
| `class="jumbotron"` | `<header>` with hero styles |
|
|
549
|
+
|
|
550
|
+
## Related Resources
|
|
551
|
+
|
|
552
|
+
- **React Components** - See layout component README
|
|
553
|
+
- **MDN: HTML5 Sectioning Elements** -
|
|
554
|
+
https://developer.mozilla.org/en-US/docs/Web/HTML/Element#content_sectioning
|
|
555
|
+
- **W3C ARIA: Landmark Regions** -
|
|
556
|
+
https://www.w3.org/WAI/ARIA/apg/patterns/landmarks/
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Meta } from "@storybook/addon-docs/blocks";
|
|
2
|
+
|
|
3
|
+
<Meta title="FP.REACT Components/Link/Styles" />
|
|
4
|
+
|
|
5
|
+
# Link Styles
|
|
6
|
+
|
|
7
|
+
Enhanced anchor link styling with button variants and WCAG 2.1 AA compliance.
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
The fpkit link system provides accessible, customizable link styles with support
|
|
12
|
+
for standard text links, button-styled links, and pill variants.
|
|
13
|
+
|
|
14
|
+
### Key Features
|
|
15
|
+
|
|
16
|
+
- **Text decoration control** - Customizable underlines
|
|
17
|
+
- **Button-styled links** - Links that look like buttons
|
|
18
|
+
- **Pill variant** - Fully rounded links
|
|
19
|
+
- **WCAG compliant** - Focus indicators and color contrast
|
|
20
|
+
- **CSS custom properties** - Full theming control
|
|
21
|
+
- **Rem-based sizing** - All measurements use rem units (1rem = 16px)
|
|
22
|
+
|
|
23
|
+
## CSS Custom Properties
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
a[href] {
|
|
27
|
+
/* Color & Typography */
|
|
28
|
+
--link-color: #085ab7;
|
|
29
|
+
--link-fw: 400;
|
|
30
|
+
--link-fs: 1rem;
|
|
31
|
+
|
|
32
|
+
/* Text Decoration */
|
|
33
|
+
--link-decoration: none;
|
|
34
|
+
--link-decoration-offset: 0.09375rem; /* 1.5px */
|
|
35
|
+
--link-decoration-thickness: 0.0625rem; /* 1px */
|
|
36
|
+
|
|
37
|
+
/* Background & Border */
|
|
38
|
+
--link-bg: transparent;
|
|
39
|
+
--link-radius: 0.25rem;
|
|
40
|
+
|
|
41
|
+
/* Transitions */
|
|
42
|
+
--link-transition: all 0.35s ease-in-out;
|
|
43
|
+
|
|
44
|
+
/* Focus (WCAG 2.4.7) */
|
|
45
|
+
--link-focus-color: currentColor;
|
|
46
|
+
--link-focus-width: 0.125rem; /* 2px */
|
|
47
|
+
--link-focus-offset: 0.125rem;
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Link Types
|
|
52
|
+
|
|
53
|
+
### Standard Link
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<a href="/page">Standard Link</a>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Button-Styled Link
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<a href="/action" data-btn>Button Link</a>
|
|
63
|
+
<a href="/action"><b>Button Link</b></a>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Pill Link
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<a href="/action" data-link="pill">Pill Link</a>
|
|
70
|
+
<a href="/action"><i>Pill Link</i></a>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Related Resources
|
|
74
|
+
|
|
75
|
+
- **MDN: Links** - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a
|