You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/skills/components/page-hero-highlights.md
+35-18Lines changed: 35 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,8 +17,8 @@ The layout uses a 4-row CSS Grid with `subgrid` — no `translate`, negative mar
17
17
|`tag`|`"div" \| "section" \| "main"`|`"div"`| Root element tag |
18
18
|`highlightsEqualWidths`|`boolean`|`false`| Equal-width grid columns for highlight items |
19
19
|`highlightsJustify`|`"start" \| "center" \| "end" \| "space-between" \| "space-around"`|`"start"`| Alignment of highlight items along the main axis |
20
-
|`maxWidth`|`string`|`undefined`| Cap the central content column (e.g. `"1064px"`). Gutters grow to enforce the constraint; below this width they hold at `16px`. |
21
-
|`contentAlign`|`"start" \| "center"`|`"center"`| When `maxWidth` is set: `"center"` grows gutters equally; `"start"` pins content to the left with a fixed `16px`left gutter. |
20
+
|`maxWidth`|`boolean`|`false`| When `true`, caps the central column at `--max-width` (default `1064px`). Gutters grow responsively to enforce the constraint. |
21
+
|`contentAlign`|`"start" \| "center"`|`"center"`| When `maxWidth` is `true`: `"center"` grows gutters equally; `"start"` pins content to the left with a fixed left gutter.|
22
22
|`contentPanel`|`boolean`|`true`| When `true`, renders a decorative panel behind the content slot and offsets the highlights strip. Set to `false` for a flat layout with no backdrop. |
23
23
|`highlightTitleBaseline`|`boolean`|`false`| When `true`, fixes the highlight title row to a set height so titles align at a common baseline. Override `--highlight-title-height` to tune. |
24
24
|`styleClassPassthrough`|`string \| string[]`|`[]`| Extra classes on the root element |
@@ -66,7 +66,7 @@ Each slot accepts any content, but these library components are natural fits:
|`--phh-padding-block-mobile`|`1.6rem 3.2rem`| Block padding (start end) at mobile widths |
112
+
|`--phh-padding-block-tablet`|`2.4rem 4.8rem`| Block padding (start end) at ≥768px |
113
+
|`--phh-padding-block-desktop`|`3.2rem 6.4rem`| Block padding (start end) at ≥1024px |
114
+
|`--phh-gap`|`1.6rem`| Gap between `#start` and `#end` areas |
115
+
|`--phh-end-gap`|`0.8rem`| Gap between items within `#end`|
114
116
115
117
### Usage
116
118
@@ -170,17 +172,26 @@ By default, highlight items size to their content (`flex-wrap`). Pass `:highligh
170
172
171
173
## Constraining the central column width
172
174
173
-
Pass `max-width` to cap the content column. The gutters grow to enforce it — full-bleed backgrounds are unaffected and `subgrid` continues to work. Use `content-align` to pin to the left or centre:
175
+
Pass `:max-width="true"` to cap the content column at `--max-width` (default `1064px`). The gutters grow responsively to enforce it — full-bleed backgrounds are unaffected and `subgrid` continues to work. Use `content-align` to pin to the left or centre:
@@ -239,8 +256,6 @@ See [component-local-style-override.md](../component-local-style-override.md) fo
239
256
</style>
240
257
```
241
258
242
-
> **Note:** The minimum gutter width (`16px`) and layout behaviour are not overridable via CSS custom properties. Use the `max-width` and `content-align` props to control column constraints.
`.header-row` spans cols 1–3, rows 1–2 (edge-to-edge bg). `.header-slot` is placed in row 1 only.
255
270
`.content-row` spans cols 1–3, rows 3–4 (bg fills behind highlights; `.content-slot` is placed in row 4 only). The decorative border behind `.content-slot` is rendered via `.content-row:before` — there is no separate DOM element for it.
256
271
272
+
Grid columns are determined entirely by CSS — no `v-bind`. The `maxWidth` and `contentAlign` props add CSS classes (`max-width`, `start`, `center`) which select the appropriate `grid-template-columns` rule.
273
+
257
274
## Layout pitfall: do not use `grid-template-rows: subgrid` inside `.highlights-row`
258
275
259
276
The `.highlights-row` element spans rows 2–3 of the parent grid (the "straddle"). If you add an inner grid to `.highlights-row` (e.g. to extend `equal-widths` behaviour) and include `grid-template-rows: subgrid`, auto-placed items will only occupy row 1 of the subgrid (= parent row 2). Parent row 3 collapses to 0-height, destroying the straddle effect — `.content-row` appears immediately below the highlights instead of overlapping it.
@@ -280,5 +297,5 @@ The `.highlights-row` element spans rows 2–3 of the parent grid (the "straddle
280
297
- Component is auto-imported in Nuxt — no import needed.
281
298
- Lives in `app/components/04.templates/page-hero-highlights/`.
-**Minimum gutter is fixed at `16px`** — it is baked into the `gridColumns` computed and cannot be overridden by a CSS custom property. If a consumer needs a different minimum (e.g. `24px`), it requires a prop or a fork of the component.
284
-
-**`contentAlign` has no effect without `maxWidth`** — both sides always hold `16px` when `maxWidth` is not set.
300
+
-**`contentAlign` has no effect when `maxWidth` is `false`** — both gutters hold their responsive default.
301
+
-**Gutter sizes are CSS tokens** — `--page-hero-highlights-gutter-mobile/tablet/desktop` are all overridable. The responsive switching between them (via `@container`) is handled internally and cannot be overridden.
Copy file name to clipboardExpand all lines: .claude/skills/css-grid-max-width-gutters.md
+38-2Lines changed: 38 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,10 +31,47 @@ Left gutter stays fixed, content column is capped at `MAX_WIDTH`, remaining spac
31
31
32
32
## In Vue with a prop
33
33
34
+
### OptionA — CSS tokens + class selectors (preferred when max-width is a fixed design value)
35
+
36
+
When the max-width and gutter values are fixed design tokens (not arbitrary consumer strings), express the logic entirely in CSS using a boolean `maxWidth` prop that adds a class:
Consumers can override `--max-width` and `--gutter` via `styleClassPassthrough` without touching the prop. This is the approach used by `PageHeroHighlights`.
69
+
70
+
### Option B — computed string with `v-bind` (use when max-width is a dynamic consumer prop)
71
+
34
72
Because `v-bind()` in `<style>` can't be nested inside CSS functions like `max()`, build the column string as a computed and bind the whole value:
"Max width of the central content column. Gutters grow to enforce the constraint; below this width they hold at 16px.",
40
+
"When true, caps the central column at --max-width (default 1064px). Gutters grow responsively to enforce the constraint. Override --max-width via styleClassPassthrough to change the cap value.",
42
41
},
43
42
contentAlign: {
44
43
control: {type: "inline-radio"},
@@ -78,7 +77,7 @@ const meta: Meta<StoryArgs> = {
78
77
tag: "div",
79
78
highlightsEqualWidths: false,
80
79
highlightsJustify: "start",
81
-
maxWidth: "",
80
+
maxWidth: false,
82
81
contentAlign: "center",
83
82
contentPanel: true,
84
83
highlightTitleBaseline: false,
@@ -119,6 +118,12 @@ All layout and visual properties are customisable via CSS custom properties. Set
119
118
120
119
\`\`\`css
121
120
.page-hero-highlights {
121
+
/* Grid layout */
122
+
--max-width: 1064px;
123
+
--page-hero-highlights-gutter-mobile: 16px;
124
+
--page-hero-highlights-gutter-tablet: 40px;
125
+
--page-hero-highlights-gutter-desktop: 32px;
126
+
122
127
/* Header zone */
123
128
--header-row-background-colour: darkblue;
124
129
@@ -196,6 +201,12 @@ All layout and visual properties are customisable via CSS custom properties. Set
<p class="page-body-normal">Content column is capped at 800px, aligned to the start — right side takes the remaining space.</p>
397
+
<p class="page-body-normal">Content column is capped at --max-width (1064px by default), aligned to the start — right side takes the remaining space.</p>
0 commit comments