-
Notifications
You must be signed in to change notification settings - Fork 338
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
Add override class for tabular numbers #4973
Conversation
📋 StatsFile sizes
Modules
View stats and visualisations on the review app Action run for f262500 |
Stylesheets changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
index 75a932582..de91626e8 100644
--- a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
+++ b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
@@ -7585,6 +7585,10 @@ screen and (-ms-high-contrast:active) {
font-weight: 700 !important
}
+.govuk-\!-font-tabular-numbers {
+ font-variant-numeric: tabular-nums !important
+}
+
.govuk-\!-width-full,
.govuk-\!-width-three-quarters {
width: 100% !important
Action run for f262500 |
Other changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/overrides/_typography.scss b/packages/govuk-frontend/dist/govuk/overrides/_typography.scss
index 8ff1d7a7e..8afef6c1c 100644
--- a/packages/govuk-frontend/dist/govuk/overrides/_typography.scss
+++ b/packages/govuk-frontend/dist/govuk/overrides/_typography.scss
@@ -27,6 +27,12 @@
.govuk-\!-font-weight-bold {
@include govuk-typography-weight-bold($important: true);
}
+
+ // Tabular numbers
+
+ .govuk-\!-font-tabular-numbers {
+ @include govuk-font-tabular-numbers($important: true);
+ }
}
/*# sourceMappingURL=_typography.scss.map */
Action run for f262500 |
81667dd
to
f262500
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me 👍🏻
There's a tricky thing here around what to name it. We've currently got the convention with our overrides that they follow the same rule written out in css as a kebab case class eg: font-weight: bold
becomes font-weight-bold
. Therefore should this be govuk-!-font-variant-numeric-tabular-nums
or some variant? I personally think this is a reasonable tradeoff as the full class name looks a bit yucky. We could experiment with variants but I still think this communicates what it is.
Adds an override class that invokes the
govuk-font-tabular-numbers
mixin.I think this is a necessary feature to help meet alphagov/govuk-design-system#1233, as users are currently unable to use tabular numbers without using Sass—which in turn requires having a Sass build pipeline set up and authoring bespoke code—which is a bit of a faff, really.