Skip to content

Add interruption panel - adjust spacing and typography#7243

Merged
NickColley merged 1 commit into
add-interruption-panel--localfrom
add-interruption-pabel--adjust-spacing
Jul 3, 2026
Merged

Add interruption panel - adjust spacing and typography#7243
NickColley merged 1 commit into
add-interruption-panel--localfrom
add-interruption-pabel--adjust-spacing

Conversation

@NickColley

@NickColley NickColley commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Note

A final review will be available once we get the contribution branch ready
I will manually merge this into #6636 once approved since we cant merge into a external repo via GitHub

  • adjust the title size to better balance with smaller text (e.g. govuk-body).
  • adjust the spacing of the panel and Button group so it is better balanced

Why not use .govuk-panel__title--l like NHS's implementation?

We decided by adding this it implies the heading scale and we dont have a clear need for the other sizes, so for now we'll just apply a smaller title by default and see if a need arises for something more involved.

Paired on with @mia-allers-gds

@NickColley NickColley changed the title Adjust spacing of the Interruption panel Add interruption panel - adjust spacing and typography Jul 2, 2026
@NickColley NickColley force-pushed the add-interruption-panel--local branch from 587f242 to d82f21e Compare July 2, 2026 15:08
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Stylesheets changes to npm package

diff --git a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
index 9e949019e..2e0d429e3 100644
--- a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
+++ b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
@@ -4277,6 +4277,7 @@ screen and (forced-colors:active) {
     }
 }
 
+.govuk-panel__body>:last-child,
 .govuk-panel__title:last-child {
     margin-bottom: 0
 }
@@ -4295,6 +4296,36 @@ screen and (forced-colors:active) {
     text-align: left
 }
 
+.govuk-panel--interruption .govuk-panel__title {
+    font-size: 1.6875rem;
+    line-height: 1.1111111111;
+    margin-bottom: 15px
+}
+
+@media (min-width:40.0625em) {
+    .govuk-panel--interruption .govuk-panel__title {
+        font-size: 2.25rem;
+        line-height: 1.1111111111
+    }
+}
+
+@media print {
+    .govuk-panel--interruption .govuk-panel__title {
+        font-size: 24pt;
+        line-height: 1.05
+    }
+}
+
+.govuk-panel--interruption .govuk-panel__body>.govuk-button-group:last-child {
+    margin-top: 40px
+}
+
+@media (min-width:40.0625em) {
+    .govuk-panel--interruption:has(.govuk-panel__body>.govuk-button-group:last-child) {
+        padding-bottom: 25px
+    }
+}
+
 @media print {
     .govuk-panel {
         --govuk-text-colour: inherit;

Action run for 3a06c6a

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Other changes to npm package

diff --git a/packages/govuk-frontend/dist/govuk/components/panel/_mixin.scss b/packages/govuk-frontend/dist/govuk/components/panel/_mixin.scss
index 9b095e041..d3973740c 100644
--- a/packages/govuk-frontend/dist/govuk/components/panel/_mixin.scss
+++ b/packages/govuk-frontend/dist/govuk/components/panel/_mixin.scss
@@ -43,7 +43,10 @@
     margin-bottom: base.govuk-spacing(6);
   }
 
-  .govuk-panel__title:last-child {
+  // Remove bottom spacing from anything at the end of the Panel's body
+  // to stop the Panel's padding spacing from becoming too large.
+  .govuk-panel__title:last-child,
+  .govuk-panel__body > :last-child {
     margin-bottom: 0;
   }
 
@@ -56,6 +59,27 @@
     --govuk-text-colour: #{base.govuk-functional-colour(inverse-text)};
     background: base.govuk-functional-colour(brand);
     text-align: left;
+
+    // Smaller title to go alongside smaller body text.
+    .govuk-panel__title {
+      @include base.govuk-font-size($size: 36);
+      margin-bottom: base.govuk-spacing(3);
+    }
+
+    // When the Button group is at the end of the Panel's body then,
+    // make sure it has some spacing away from the other body content.
+    .govuk-panel__body > .govuk-button-group:last-child {
+      margin-top: base.govuk-spacing(7);
+    }
+
+    // On larger screens if the Interruption panel has a Button group at the end of the Panel's body,
+    // then we want to adjust the spacing a bit to avoid the Button group
+    // making the Panel's padding spacing being too large.
+    @media #{base.govuk-from-breakpoint(tablet)} {
+      &:has(.govuk-panel__body > .govuk-button-group:last-child) {
+        padding-bottom: base.govuk-spacing(5);
+      }
+    }
   }
 
   @media print {

Action run for 3a06c6a

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

📋 Stats

File sizes

File Size Percentage change
dist/govuk-frontend-development.min.css 122.94 KiB 0.5%
packages/govuk-frontend/dist/govuk/govuk-frontend.min.css 122.93 KiB 0.5%

No changes to module sizes.


Action run for 3a06c6a

@NickColley NickColley force-pushed the add-interruption-pabel--adjust-spacing branch from 6cfc93f to db06f94 Compare July 2, 2026 15:10
@NickColley NickColley marked this pull request as ready for review July 2, 2026 15:21
@NickColley NickColley force-pushed the add-interruption-pabel--adjust-spacing branch from db06f94 to 9b1293b Compare July 2, 2026 15:26
@NickColley NickColley force-pushed the add-interruption-pabel--adjust-spacing branch from 9b1293b to cb89cb2 Compare July 2, 2026 15:47
Contextually adjust spacing if the Button group is at the end of the Panel.
@NickColley NickColley force-pushed the add-interruption-pabel--adjust-spacing branch from cb89cb2 to 3a06c6a Compare July 2, 2026 16:05
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-7243 July 2, 2026 16:05 Inactive

@mia-allers-gds mia-allers-gds left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good!

@NickColley

Copy link
Copy Markdown
Contributor Author

@romaricpascal all yours! I think the main thing that the approach does is it's decidedly not BEM, which feels a bit odd but not sure how we resolve that without doing it more like the MoJ component

https://design-patterns.service.justice.gov.uk/components/interruption-card/

We decided not to do this because we didnt want to think of how having button groups in the Nunjuck would make sense with Confirmation panel.

Let me know your thoughts.

@romaricpascal

Copy link
Copy Markdown
Member

@NickColley Do you mean that given both the Confirmation Panel and the Interruption panel share the same options, primaryAction and secondaryAction options like in the MoJ wouldn't really make sense for a Confirmation Panel?

@romaricpascal

Copy link
Copy Markdown
Member

What are we planning documentation-wise around the actions of the panel? We'll need to make it clear the actions should be wrapped in a .govuk-button-group element.

@NickColley

Copy link
Copy Markdown
Contributor Author

What are we planning documentation-wise around the actions of the panel? We'll need to make it clear the actions should be wrapped in a .govuk-button-group element.

This'll be done by example, the examples in the Design System website will show the Button group being used.

@romaricpascal romaricpascal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code wise, I'd say let's merge it with the current selector. We can review markup and Nunjucks options in a separate pull request focused on those implementation details 😊

@NickColley

NickColley commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Will merge cos the design is good pending iteration and then raise a issue to consider the Nunjuck api we've discussed cos to me it does feel more consistent with say, the Cookie banner that way.

Nothing is breaking until we ship so it's cool to change our mind.

alphagov/govuk-design-system#5456

@NickColley NickColley merged commit 76a0297 into add-interruption-panel--local Jul 3, 2026
48 checks passed
@NickColley NickColley deleted the add-interruption-pabel--adjust-spacing branch July 3, 2026 07:27
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.

4 participants