Skip to content

Commit

Permalink
Rename custom SCSS class (#526)
Browse files Browse the repository at this point in the history
https://eaflood.atlassian.net/browse/WATER-4131

When working on [Fix display of credit transactions in bill views](#522) after adding the missing `-` to credit values we found the UI was wrapping it _after_ the sign, for example

```
      -
£126.74
```

We knew we could fix this by updating the CSS for the class to include `white-space: nowrap;`. The issue was where do we add it. We wasted a bunch of time trying to find the class `govuk-table__cell--total` in the design system code. Finally, we tracked it now to a custom class we'd added.

This change is about not making that mistake again and trying to set a precedent. From now on, if we have to add a custom class we should ***not*** prefix it with `govuk` so we can distinguish between our code and that provided by GDS.
  • Loading branch information
Cruikshanks authored Nov 15, 2023
1 parent d40480d commit c386550
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/views/bill-licences/view-presroc.njk
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,13 @@
{% set totalRow = [
{
text: 'Total',
classes: 'govuk-table__cell--total',
classes: 'table__cell--total',
colspan: tableHeaders | length - 1
},
{
text: transactionsTotal,
format: 'numeric',
classes: 'govuk-table__cell--total govuk-!-font-weight-bold',
classes: 'table__cell--total govuk-!-font-weight-bold',
attributes: { 'data-test': 'total' }
}
] %}
Expand Down
4 changes: 2 additions & 2 deletions app/views/bill-licences/view-sroc.njk
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,13 @@
{% set totalRow = [
{
text: 'Total',
classes: 'govuk-table__cell--total',
classes: 'table__cell--total',
colspan: tableHeaders | length - 1
},
{
text: transactionsTotal,
format: 'numeric',
classes: 'govuk-table__cell--total govuk-!-font-weight-bold',
classes: 'table__cell--total govuk-!-font-weight-bold',
attributes: { 'data-test': 'total' }
}
] %}
Expand Down
4 changes: 2 additions & 2 deletions app/views/bills/view-single-licence-presroc.njk
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,13 @@
{% set totalRow = [
{
text: 'Total',
classes: 'govuk-table__cell--total',
classes: 'table__cell--total',
colspan: tableHeaders | length - 1
},
{
text: transactionsTotal,
format: 'numeric',
classes: 'govuk-table__cell--total govuk-!-font-weight-bold',
classes: 'table__cell--total govuk-!-font-weight-bold',
attributes: { 'data-test': 'total' }
}
] %}
Expand Down
4 changes: 2 additions & 2 deletions app/views/bills/view-single-licence-sroc.njk
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,13 @@
{% set totalRow = [
{
text: 'Total',
classes: 'govuk-table__cell--total',
classes: 'table__cell--total',
colspan: tableHeaders | length - 1
},
{
text: transactionsTotal,
format: 'numeric',
classes: 'govuk-table__cell--total govuk-!-font-weight-bold',
classes: 'table__cell--total govuk-!-font-weight-bold',
attributes: { 'data-test': 'total' }
}
] %}
Expand Down
2 changes: 1 addition & 1 deletion client/sass/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ $govuk-global-styles: true;
// ========== ========== ========== ========== ==========
// Table additions
// ========== ========== ========== ========== ==========
.govuk-table__cell--total {
.table__cell--total {
@media (min-width: 768px) {
border-top: solid 2px #0b0c0c !important;
border-bottom: none !important;
Expand Down

0 comments on commit c386550

Please sign in to comment.