Skip to content

Instantly share code, notes, and snippets.

@hawx
Last active June 24, 2025 09:33
Show Gist options
  • Save hawx/ef9282d93fe33bd21bdcdd46f6a3d831 to your computer and use it in GitHub Desktop.
Save hawx/ef9282d93fe33bd21bdcdd46f6a3d831 to your computer and use it in GitHub Desktop.
Progress component
$govuk-assets-path: "/static/assets/";
.app-progress-bar {
margin-bottom: govuk-spacing(7);
}
.app-progress-bar__list {
font-size: 0; // Stop the connecting line from extending past the last item
list-style: none;
padding: 0;
position: relative;
&::before {
border-left: 6px solid govuk-colour("green");
content: "";
left: 13px;
position: absolute;
height: 100%;
}
}
.app-progress-bar__item {
@include govuk-font(19);
display: flex;
position: relative;
flex-wrap: nowrap;
padding-bottom: 0.3rem;
&:first-child {
&::before {
border-left: 6px solid govuk-colour("green");
content: "";
position: absolute;
}
}
&:last-child {
&::before {
border-left: 6px solid govuk-colour("white"); // Stop the connecting line from extending past the last item
content: "";
left: 13px;
position: absolute;
height: 100%;
}
}
}
.app-progress-bar__icon {
position: relative;
background-color: govuk-colour("white");
border: 6px solid govuk-colour("green");
border-radius: 50%;
box-sizing: border-box;
height: 32px;
width: 32px;
min-width: 32px;
min-height: 32px;
margin-right: 0.5rem;
}
.app-progress-bar__icon--complete {
background-color: govuk-colour("green");
background-image: url(#{$govuk-assets-path}images/icon-progress-tick.svg);
background-position: 50% 50%;
background-repeat: no-repeat;
}
.app-progress-bar__label {
@include govuk-font(19);
display: flex;
font-weight: inherit;
flex-wrap: wrap;
align-content: center;
}
<div id="progress" class="app-progress-bar" aria-label="progress-label">
<ol class="app-progress-bar__list">
<li class="app-progress-bar__item">
<span class="app-progress-bar__icon app-progress-bar__icon--complete"></span>
<span class="app-progress-bar__label">
First step<span class="govuk-visually-hidden"> completed</span>
</span>
</li>
<li class="app-progress-bar__item">
<span class="app-progress-bar__icon app-progress-bar__icon--complete"></span>
<span class="app-progress-bar__label">
Second step<span class="govuk-visually-hidden"> completed</span>
</span>
</li>
<li class="app-progress-bar__item">
<span class="app-progress-bar__icon"></span>
<span class="app-progress-bar__label">
Third step<span class="govuk-visually-hidden"> not completed</span>
</span>
</li>
</ol>
</div>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment