Skip to content

[v10] Extend global inline code styles#1984

Merged
frankieroberto merged 9 commits into
support/10.xfrom
apply-code-style-in-summary-lists
Jun 29, 2026
Merged

[v10] Extend global inline code styles#1984
frankieroberto merged 9 commits into
support/10.xfrom
apply-code-style-in-summary-lists

Conversation

@frankieroberto

@frankieroberto frankieroberto commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Discovered an issue in nhsuk/nhsuk-service-manual#2585 that <code> elements within a summary list don't get the red-on-white colour.

This fixes that. Also extends the inline code style to where they are within <th> elements.

Before After
Screenshot 2026-06-23 at 14 54 03 Screenshot 2026-06-23 at 14 53 31

Checklist

@colinrotherham colinrotherham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @frankieroberto

Cache retrieval is failing again (even though it was just saved). Might have to run the actions a few more times—they must be having a slow day again

Am I right in thinking the code block page examples are duplicated?

Once for normal, once for reverse

@frankieroberto frankieroberto temporarily deployed to nhsuk-frontend-pr-1984 June 23, 2026 14:08 Inactive
@frankieroberto

Copy link
Copy Markdown
Contributor Author

@colinrotherham duplicated the example into the reverse section now:

Screenshot 2026-06-23 at 15 08 03

Comment thread packages/nhsuk-frontend-review/src/examples/code-blocks.njk Outdated
Co-authored-by: Colin Rotherham <work@colinr.com>
@frankieroberto frankieroberto temporarily deployed to nhsuk-frontend-pr-1984 June 23, 2026 14:15 Inactive
@anandamaryon1 anandamaryon1 added this to the 10.6.0 milestone Jun 23, 2026
@anandamaryon1

anandamaryon1 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Nice thanks for this @frankieroberto

Should the reverse styles be using nhsuk-code--reverse?

eg. top one here:
Screenshot 2026-06-23 at 15 45 17

@frankieroberto frankieroberto temporarily deployed to nhsuk-frontend-pr-1984 June 23, 2026 14:58 Inactive
@frankieroberto

Copy link
Copy Markdown
Contributor Author

@anandamaryon1

Nice thanks for this @frankieroberto

Should the reverse styles be using nhsuk-code--reverse?

Ah good spot. Done in f942a17. It needs the nhsuk-code--inline class adding too for some reason.

Arguably the inverse style could be applied automatically, but that’s a whole other can of worms so maybe leave that for now? (The govuk design system team are looking at this too)

Comment thread packages/nhsuk-frontend-review/src/examples/code-blocks.njk Outdated
@frankieroberto frankieroberto temporarily deployed to nhsuk-frontend-pr-1984 June 23, 2026 15:46 Inactive
Comment thread packages/nhsuk-frontend-review/src/examples/code-blocks.njk Outdated
Comment thread packages/nhsuk-frontend-review/src/examples/code-blocks.njk Outdated

@colinrotherham colinrotherham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @frankieroberto 🙌

Just needs a changelog entry?

Probably adjust the PR title to say we're adding global styles (I think we say this?) for inline code elements within table heading, description term and description details elements?

i.e. Whilst it does apply to the summary list these are global styles

Co-authored-by: Colin Rotherham <work@colinr.com>
@frankieroberto frankieroberto temporarily deployed to nhsuk-frontend-pr-1984 June 23, 2026 16:43 Inactive
@frankieroberto frankieroberto changed the title Bugfix: Apply code style in summary lists Extend global inline code styles Jun 23, 2026
@frankieroberto frankieroberto temporarily deployed to nhsuk-frontend-pr-1984 June 23, 2026 17:30 Inactive
@frankieroberto frankieroberto temporarily deployed to nhsuk-frontend-pr-1984 June 23, 2026 17:31 Inactive
@colinrotherham colinrotherham changed the title Extend global inline code styles [v10] Extend global inline code styles Jun 24, 2026
@colinrotherham

Copy link
Copy Markdown
Contributor

Ah good spot. Done in f942a17. It needs the nhsuk-code--inline class adding too for some reason.

Can I have your thoughts on this?

i.e. Should we make <code> global (no parent restrictions) and remove .nhsuk-code--inline?

@frankieroberto

Copy link
Copy Markdown
Contributor Author

@colinrotherham:

Can I have your thoughts on this?

i.e. Should we make <code> global (no parent restrictions) and remove .nhsuk-code--inline?

Feels like it could be one for a follow-up PR as we consider global styles more generally? 🤷‍♂️

@frankieroberto frankieroberto merged commit d49bb29 into support/10.x Jun 29, 2026
23 checks passed
@frankieroberto frankieroberto deleted the apply-code-style-in-summary-lists branch June 29, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants