Skip to content

Commit

Permalink
Change the table modifier to generic modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
frankieroberto committed Nov 19, 2024
1 parent 9a77bc0 commit 4cfc228
Showing 4 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/components/tables/table-with-more-columns.njk
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@
},
{
text: "stephanie.meyer9@test.com",
classes: "nhsuk-table__cell--break-word"
classes: "nhsuk-u-word-break-all"
},
{
text: "Active"
@@ -50,7 +50,7 @@
},
{
text: "aleksandrina.featherstonehaughwhitehead23@folkestonepharmacy.test.com",
classes: "nhsuk-table__cell--break-word"
classes: "nhsuk-u-word-break-all"
},
{
text: "Inactive"
5 changes: 0 additions & 5 deletions packages/components/tables/_tables.scss
Original file line number Diff line number Diff line change
@@ -174,8 +174,3 @@
.nhsuk-table__cell--numeric {
text-align: right;
}

.nhsuk-table__header--break-word,
.nhsuk-table__cell--break-word {
word-break: break-all;
}
1 change: 1 addition & 0 deletions packages/core/all.scss
Original file line number Diff line number Diff line change
@@ -43,3 +43,4 @@
@import "utilities/typography";
@import "utilities/visually-hidden";
@import "utilities/widths";
@import "utilities/word-breaks";
16 changes: 16 additions & 0 deletions packages/core/utilities/_word-breaks.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// ==========================================================================
// UTILITIES / #WORD-BREAK
// ==========================================================================

/**
* This class allows words to be broken between any 2
* to avoid overflowing their container.
*
* This can be useful on table cells which could contain
* long strings such as email addresses.
*
* Usage: class="nhsuk-u-word-break-all"
*/
.nhsuk-u-word-break-all {
word-break: break-all;
}

0 comments on commit 4cfc228

Please sign in to comment.