Remove the first letter modifier from the tag component #3731
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Removes the
first-letter
modifier from the tag component, added in the redesign in #3502, and updates the changelog to recommend teams check their content and ensure the first word of their tags are capitalised.Why
In the tag redesign we added the
first-letter
selector as a way to get around the risk of teams having tags in older services that secretly have all lowercase content, hidden by the previous tag'stext-transform: uppercase
. We encountered a bug in firefox when testing this however where the width of the tag was incorrectly extended as if the contents of the entire tag hadtext-transform: uppercase
applied instead of only the first letter. We changed this totext-transform: capitalize
to get around this.Since then, we've encountered further issues in our implementation:
first-letter
selector where the browsers will treat it as a separate inline element, most easily noticeable in the Turquoise tag exampleAfter an internal discussion, we think that now the clever workaround has become too risky to use over asking teams update their tag content and risking tag capitalisation being inconsistent across GOV.UK for a period.