Skip to content

Commit

Permalink
Merge pull request #2668 from alphagov/fix-summary-list-action-alignment
Browse files Browse the repository at this point in the history
Fix Summary List action link alignment
  • Loading branch information
querkmachine authored Jun 28, 2022
2 parents 28c6c0d + 1df31ba commit db42757
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

### Fixes

We’ve made fixes to GOV.UK Frontend in the following pull requests:

- [#2668: Fix Summary List action link alignment](https://github.com/alphagov/govuk-frontend/pull/2668)

## 4.2.0 (Feature release)

### New features
Expand Down
40 changes: 31 additions & 9 deletions src/govuk/components/summary-list/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,43 @@
}

.govuk-summary-list__actions-list-item {
display: inline;
margin-right: govuk-spacing(2);
padding-right: govuk-spacing(2);
display: inline-block;
}

// In older browsers such as IE8, :last-child is not available,
// so only show the border divider where it is available.
.govuk-summary-list__actions-list-item:not(:last-child) {
border-right: 1px solid $govuk-border-colour;
@include govuk-media-query($until: tablet) {
.govuk-summary-list__actions-list-item {
margin-right: govuk-spacing(2);
padding-right: govuk-spacing(2);
}

.govuk-summary-list__actions-list-item:not(:last-child) {
border-right: 1px solid $govuk-border-colour;
}

.govuk-summary-list__actions-list-item:last-child {
margin-right: 0;
padding-right: 0;
border: 0;
}
}

.govuk-summary-list__actions-list-item:last-child {
margin-right: 0;
padding-right: 0;
border: 0;
@include govuk-media-query($from: tablet) {
.govuk-summary-list__actions-list-item {
margin-left: govuk-spacing(2);
padding-left: govuk-spacing(2);
}

.govuk-summary-list__actions-list-item:not(:first-child) {
border-left: 1px solid $govuk-border-colour;
}

.govuk-summary-list__actions-list-item:first-child {
margin-left: 0;
padding-left: 0;
border: 0;
}
}

// No border on entire summary list
Expand Down
6 changes: 3 additions & 3 deletions src/govuk/components/summary-list/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
{{ _actionLink(row.actions.items[0]) | indent(12) | trim }}
{% else %}
<ul class="govuk-summary-list__actions-list">
{% for action in row.actions.items %}
{%- for action in row.actions.items -%}
<li class="govuk-summary-list__actions-list-item">
{{ _actionLink(action) | indent(18) | trim }}
{{- _actionLink(action) | indent(18) | trim -}}
</li>
{% endfor %}
{%- endfor -%}
</ul>
{% endif %}
</dd>
Expand Down
2 changes: 1 addition & 1 deletion tasks/gulp/compile-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const cssnano = require('cssnano')
const postcsspseudoclasses = require('postcss-pseudo-classes')({
// Work around a bug in pseudo classes plugin that badly transforms
// :not(:whatever) pseudo selectors
blacklist: [':not(', ':disabled)', ':last-child)', ':focus)', ':active)', ':hover)']
blacklist: [':not(', ':disabled)', ':first-child)', ':last-child)', ':focus)', ':active)', ':hover)']
})

// Compile CSS and JS task --------------
Expand Down

0 comments on commit db42757

Please sign in to comment.