You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce a new mixin that can be used to turn on typographic numbers without needing to call the govuk-font mixin.
Update any components that currently call govuk-font with $tabular: true to use the new mixin.
Update the govuk-font mixin to use the new mixin whilst maintaining the existing behaviour.
Optionally, we could also decide to deprecate (and in the future remove) the $tabular param on the govuk-font mixin and tell people to use the new mixin instead.
Why
The current implementation is an artefact of the way tabular numbers used to work when compatibility mode was enabled, when we had to switch out the font entirely rather than just switching some font variant settings:
Because govuk-font includes govuk-typography-common, our current approach means that switching on tabular numbers also brings in all of the common typography declarations including the font-face, even when they are not required.
For example, the CSS for the govuk-table__cell--numeric modifier class currently looks like this:
What
Introduce a new mixin that can be used to turn on typographic numbers without needing to call the
govuk-font
mixin.Update any components that currently call
govuk-font
with$tabular: true
to use the new mixin.Update the
govuk-font
mixin to use the new mixin whilst maintaining the existing behaviour.Optionally, we could also decide to deprecate (and in the future remove) the
$tabular
param on thegovuk-font
mixin and tell people to use the new mixin instead.Why
The current implementation is an artefact of the way tabular numbers used to work when compatibility mode was enabled, when we had to switch out the font entirely rather than just switching some font variant settings:
govuk-frontend/packages/govuk-frontend/src/govuk/helpers/_typography.scss
Line 189 in 3f13765
Because
govuk-font
includesgovuk-typography-common
, our current approach means that switching on tabular numbers also brings in all of the common typography declarations including the font-face, even when they are not required.For example, the CSS for the
govuk-table__cell--numeric
modifier class currently looks like this:When it could just look like this:
Who needs to work on this
Developers
Who needs to review this
Developers
Done when
govuk-font
with$tabular: true
to use the new mixingovuk-font
mixin to use the new mixin whilst maintaining the existing behaviour$tabular
param on thegovuk-font
mixinThe text was updated successfully, but these errors were encountered: