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
fix: de-hardcode ServicesSection copy/CSS and add cta-panel override slot
GlassPanel CTA text and section subheadings were hardcoded strings ported
from another project (including a copy bug where every service's CTA read
"Ready to book your highlights appointment?" regardless of the service).
These are now props (processHeading, idealForHeading, maintenanceHeading,
faqsHeading, ctaHeading, ctaBody), with a new cta-panel scoped slot for
consumers who need to replace the CTA block entirely.
Also namespaces internal CSS classes to services-section__* BEM naming
(previously unprefixed and collision-prone), removes a dead .glass-card
rule, and exposes layout/spacing values as --services-section-* custom
properties. Adds CONSUMER-STYLING.md, updates the services-section skill
doc and VS Code snippet, and refreshes the Storybook stories with content
matching the real service detail page.
Copy file name to clipboardExpand all lines: .claude/skills/components/services-section.md
+62-6Lines changed: 62 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,14 +15,40 @@ All routing and CTA decisions are delegated to the consumer via slots.
15
15
|------|------|---------|----------|
16
16
|`serviceData`|`Service`| — |**yes**|
17
17
|`tag`|`"div" \| "section" \| "article" \| "main"`|`"div"`| no |
18
+
|`headerTag`|`"h1" \| "h2" \| "h3"`|`"h2"`| no |
18
19
|`index`|`number`|`0`| no |
19
20
|`isSummary`|`boolean`|`false`| no |
20
21
|`summaryAlignment`|`"start" \| "center" \| "end"`|`"center"`| no |
21
22
|`reverse`|`boolean`|`false`| no |
22
23
|`durationIcon`|`string`|`"mdi:clock-time-four-outline"`| no |
23
24
|`priceIcon`|`string`|`"mdi:currency-gbp"`| no |
25
+
|`processHeading`|`string`|`"The Process"`| no |
26
+
|`idealForHeading`|`string`|`"Ideal For"`| no |
27
+
|`maintenanceHeading`|`string`|`"Aftercare & Maintenance"`| no |
28
+
|`faqsHeading`|`string`|`"Frequently Asked Questions"`| no |
29
+
|`ctaHeading`|`string`|`"Ready to book your appointment?"`| no |
30
+
|`ctaBody`|`string`|`"Get in touch to book your appointment."`| no |
24
31
|`styleClassPassthrough`|`string \| string[]`|`[]`| no |
25
32
33
+
### Heading and CTA copy props
34
+
35
+
All section subheadings and the default CTA panel's heading/body are props, not hardcoded
36
+
text — override them with wording specific to the consuming business:
37
+
38
+
```vue
39
+
<ServicesSection
40
+
:service-data="service"
41
+
process-heading="How It Works"
42
+
cta-heading="Ready to book your colour appointment?"
43
+
cta-body="Mobile service across Bath — I come to you."
44
+
/>
45
+
```
46
+
47
+
Name the actual service in `ctaHeading` (rather than a generic phrase) if every service page
48
+
shares one CTA wrapper — a single hardcoded heading applied to every service previously caused
49
+
a real bug in production, where a "Colour" service page's CTA read "Ready to book your
50
+
**highlights** appointment?" regardless of which service was being viewed.
51
+
26
52
### Icon customisation
27
53
28
54
The two icons in the price/duration row default to `mdi:clock-time-four-outline` and `mdi:currency-gbp`. Override them for a different currency or icon style:
@@ -51,8 +77,12 @@ Flips the image to the right column and content to the left (CSS `order: 2` on t
51
77
|------|-----------|---------------|---------|
52
78
|`summary-link`|`{ serviceData: Service }`|`isSummary` is `true`| Navigation link below the `whatIsIt` text in summary mode |
53
79
|`cta`|`{ serviceData: Service }`|`isSummary` is `false`| CTA button/link inside the closing `GlassPanel` in full mode |
80
+
|`cta-panel`|`{ serviceData: Service, ctaHeading: string, ctaBody: string }`|`isSummary` is `false`| Replaces the entire default `GlassPanel` CTA block — use when a consumer needs a different component or layout, not just different copy |
54
81
55
-
Both slots receive `serviceData` as a scoped prop.
82
+
All three slots receive `serviceData` as a scoped prop. `cta-panel`'s default content *is*
83
+
the `GlassPanel` + `ctaHeading`/`ctaBody` + `cta` slot combination described above — providing
84
+
`cta-panel` replaces that whole block, so the `ctaHeading`/`ctaBody` props and `cta` slot are
85
+
only useful if the `cta-panel` slot fallback (or the consumer's own override) still renders them.
56
86
57
87
## Summary mode usage
58
88
@@ -102,6 +132,21 @@ Both slots receive `serviceData` as a scoped prop.
102
132
</ServicesSection>
103
133
```
104
134
135
+
## Replacing the whole CTA panel (slot override)
136
+
137
+
Use `cta-panel` instead of `ctaHeading`/`ctaBody` when the CTA needs a different component
138
+
entirely — not just different text inside `GlassPanel`:
0 commit comments