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 wrapping of long lines of text in summary list #1169

Merged
merged 1 commit into from
Feb 4, 2019
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 @@ -28,6 +28,12 @@

([PR #N](https://github.com/alphagov/govuk-frontend/pull/N))

- Fix wrapping of long lines of text in summary list

Thanks to [@MoJ-Longbeard](https://github.com/MoJ-Longbeard) for raising the issue.
colinrotherham marked this conversation as resolved.
Show resolved Hide resolved

([PR #1169](https://github.com/alphagov/govuk-frontend/pull/1169))

## 2.6.0 (Feature release)

🆕 New features:
Expand Down
9 changes: 8 additions & 1 deletion src/components/summary-list/_summary-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,17 @@
}
}

.govuk-summary-list__key,
.govuk-summary-list__value {
// sass-lint:disable no-duplicate-properties
// Automatic wrapping for unbreakable text (e.g. URLs)
word-break: break-word; // WebKit/Blink only
word-break: break-all; // Standards
}

.govuk-summary-list__key {
margin-bottom: govuk-spacing(1);
@include govuk-typography-weight-bold;
word-break: break-word;
@include govuk-media-query($from: tablet) {
width: 30%;
}
Expand Down
30 changes: 30 additions & 0 deletions src/components/summary-list/summary-list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,36 @@ examples:
text: Quick
- href: '#'
text: Erase
- key:
text: Long website address
value:
html: |
<a class="govuk-link" href="https://cs.wikipedia.org/wiki/Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch">https://cs.wikipedia.org/wiki/Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch</a>
actions:
items:
- href: '#'
text: Change
visuallyHiddenText: long website address
- key:
text: Long email address
value:
html: |
<a class="govuk-link" href="mailto:webmaster@llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch.com">webmaster@llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch.com</a>
actions:
items:
- href: '#'
text: Change
visuallyHiddenText: long email address
- key:
text: No wrapping allowed
value:
html: |
<p class="govuk-body" style="white-space: nowrap;">michelle.longish.name@example.com</p>
actions:
items:
- href: '#'
text: Change
visuallyHiddenText: no wrapping allowed
- key:
text: Pneumonoultramicroscopicsilicovolcanoconiosis
value:
Expand Down