Skip to content

Add richText option to Hero#3793

Merged
sveltifier merged 1 commit intomainfrom
add-richtext-option-to-hero-component
Mar 10, 2026
Merged

Add richText option to Hero#3793
sveltifier merged 1 commit intomainfrom
add-richtext-option-to-hero-component

Conversation

@sveltifier
Copy link
Copy Markdown
Contributor

@sveltifier sveltifier commented Mar 5, 2026

What is the context of this PR?

This PR adds an optional richText option to Hero as requested by the CMS team.
https://officefornationalstatistics.atlassian.net/browse/ONSDESYS-816

How to review this PR

Check no regressions. Check that the option can be used with block-level HTML and produces valid markup in the browser (see ticket).

Checklist

This needs to be completed by the person raising the PR.

  • I have selected the correct Assignee
  • I have linked the correct Issue

@sveltifier sveltifier self-assigned this Mar 5, 2026
@sveltifier sveltifier requested a review from a team as a code owner March 5, 2026 14:16
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview, Comment Mar 5, 2026 2:16pm

@sveltifier sveltifier added the Component A component in the ONS Design System label Mar 5, 2026
Copy link
Copy Markdown
Contributor

@precious-onyenaucheya-ons precious-onyenaucheya-ons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not totally sure why we need a new parameter just for one use case, Another option would be to change the way the current text parameter works so that it accepts both plain and rich text. We have an example of that in the button component.

<span class="ons-hero__text">{{ params.text | safe }}</span>

This way, users can pass in either plain text and rich text in the same parameter

@sveltifier
Copy link
Copy Markdown
Contributor Author

@precious-onyenaucheya-ons @Dino-ONS The issue description in the linked ticket explains why this wouldn't work? It would also reduce the spacing for anyone already passing plain text? (And presumably make it different to the design?)

@sveltifier sveltifier merged commit 3e5358f into main Mar 10, 2026
13 of 14 checks passed
@sveltifier sveltifier deleted the add-richtext-option-to-hero-component branch March 10, 2026 09:37
@sveltifier sveltifier mentioned this pull request Mar 12, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component A component in the ONS Design System

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants