Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Summary List action link alignment #2668

Merged
merged 4 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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