-
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
Remove compatibility mode #2769
Comments
Where we use compatibilityThe compatibility variables, excluding tests, are referenced in the following places:
The first 2 we can ignore and remove once this work is ready to go out with 5.0 as they are examples of compatibility mode in use in our own review app. The rest however are specifying settings for the rest of the codebase. The compatibility setting is a private array which is used in the govuk-compatibility mixin and the rest set the following global variables:
All 4 of these impact various components, styles and helpers. See the below table for which components/styles/helpers are impacted and how each of these use the compatibility settings:
Before we proceed with deprecation, we should decide if any of these settings currently managed via compatibility mode vars are worth keeping and then expose them more explicitly for use by teams. My personal view is that as most of these pertain to legacy instances of govuk-frontend, they should simply be deprecated and removed. The sole exception is |
Thanks for the investigation and write up @owenatgov – that's really helpful. Digging in to the Font family definitionsThere's a slightly odd file in settings called 'typography-font-families' which contains the various font stacks that are used depending on whether govuk-frontend/src/govuk/settings/_typography-font-families.scss Lines 5 to 32 in c31c4be
These aren't really 'settings' at all, they're more like constants that represented the different options that might be used for
This leaves only govuk-frontend/src/govuk/settings/_typography-font.scss Lines 36 to 40 in c31c4be
We should get rid of the extra abstraction layer by removing the 'typography-font-families' file and all of the variables within it, and just have: $govuk-font-family: "GDS Transport", arial, sans-serif !default; Using a separate font face for tabular numbersIn GOV.UK Template, the way that we implemented tabular numbers was to have a separate font face with only the numbers 0-9 in tabular form ('ntatabularnumbers'). For all other characters, the browser would 'fall through' the font stack to the main font ('nta'). When we revised the font for GOV.UK Frontend, we added the tabular numbers as alternate glyphs in the font, which are controlled using the The govuk-frontend/src/govuk/helpers/_typography.scss Lines 186 to 199 in c31c4be
There's a chance that there are teams out there who have their own font and are relying on the alternate font face approach, who aren't using compatibility mode, but I think it's very unlikely. I'd suggest that we:
(We might also consider removing If we wanted to err on the side of caution, we could keep |
Thanks for the high quality sleuthing @36degrees. I've shuffled both these into the removal of |
@36degrees recently raised a valid point about if this would create noise from deprecation warnings for users who are staying on v4. We've decided that we're going to keep an eye on this after we release v5 and update v4 to remove the warnings if users still on v4 complain about this. |
What we'll do
We'll remove compatibility mode from GOV.UK Frontend.
Compatibility mode exists to make it easier for users to migrate from our old frameworks (GOV.UK Elements, GOV.UK Frontend Toolkit and GOV.UK Template).
When compatibility mode is enabled, GOV.UK Frontend:
Why we're doing it
We're making changes to the typography scale used in GOV.UK Frontend.
Without significant effort from us (to support two different typography scales), users who have enabled compatibility mode would see a mix of different sized text in their services.
Given that the Design System is now a live service and it's been nearly 5 years since the last release of GOV.UK Elements, we think it's now time to retire compatibility mode.
How this impacts our users
Teams that are still using our old frameworks will not be able to migrate directly to v5.0 or above. However, they will still have a migration path – they'll just need to finish migrating to the latest version of GOV.UK Frontend v4 (which will still support compatibility mode) and then upgrade to v5 in a separate step.
Epic lead
Owen
Who needs to work on this
Developers
Done when
In v4.x we will:
Tasks
In v5.0 we will:
Tasks
govuk-compatibility
mixin from codebase #2793The text was updated successfully, but these errors were encountered: