Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Preventing long text overflow. #16

Open
wants to merge 1 commit into
base: 8.x-1.x
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion css/govcms-ui.css

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions src/sass/_govcmsui-mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// GovCMS UI Mixins

// This mixin prevents long strings overflowing containers.
// Taken from https://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/

@mixin text-overflow {
word-break: break-word;
word-wrap: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
1 change: 1 addition & 0 deletions src/sass/govcms-ui.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// --- UI-Kit Bootstrap styles -----------------------------
// Variables
@import 'uikit-bootstrap/vars'; // Mixins
@import 'govcmsui-mixins';
@import 'uikit-bootstrap/mixins'; // Header, footer, etc
@import 'uikit-bootstrap/global'; // Text size etc.
@import 'uikit-bootstrap/typography'; // All elements, such as btns, wells, etc
Expand Down
5 changes: 5 additions & 0 deletions src/sass/uikit-bootstrap/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ p + p .cta-link {
}
} // main-nav

// main tag

main {
@include text-overflow;
}

// Page header
.page-header {
Expand Down