-
Notifications
You must be signed in to change notification settings - Fork 331
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
Fix Warning Text font weight when <strong>
styles are reset
#5331
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-5331
September 17, 2024 13:34
Inactive
📋 StatsFile sizes
Modules
View stats and visualisations on the review app Action run for 87b7566 |
romaricpascal
force-pushed
the
warning-text-font-weight
branch
from
September 17, 2024 13:35
ea4f2f9
to
9927286
Compare
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-5331
September 17, 2024 13:36
Inactive
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 1bbb7da0a..7fbe9acd4 100644
--- a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
+++ b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
@@ -6389,6 +6389,7 @@ screen and (-ms-high-contrast:active) {
font-size: 1rem;
line-height: 1.25;
margin-bottom: 20px;
+ font-weight: 700;
position: relative;
padding: 10px 0
}
@@ -6420,7 +6421,6 @@ screen and (-ms-high-contrast:active) {
}
.govuk-warning-text__icon {
- font-weight: 700;
box-sizing: border-box;
display: inline-block;
position: absolute;
@@ -6458,7 +6458,8 @@ screen and (-ms-high-contrast:active) {
.govuk-warning-text__text {
color: #0b0c0c;
display: block;
- padding-left: 45px
+ padding-left: 45px;
+ font-weight: inherit
}
@media print {
Action run for 87b7566 |
Other changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/components/warning-text/_index.scss b/packages/govuk-frontend/dist/govuk/components/warning-text/_index.scss
index 4e79791f2..9ee4807d2 100644
--- a/packages/govuk-frontend/dist/govuk/components/warning-text/_index.scss
+++ b/packages/govuk-frontend/dist/govuk/components/warning-text/_index.scss
@@ -2,14 +2,12 @@
.govuk-warning-text {
@include govuk-font($size: 19);
@include govuk-responsive-margin(6, "bottom");
+ @include govuk-typography-weight-bold;
position: relative;
padding: govuk-spacing(2) 0;
}
.govuk-warning-text__icon {
- // We apply this here and not at the parent level because the actual text is
- // a <strong> and so will always be bold
- @include govuk-typography-weight-bold;
box-sizing: border-box;
display: inline-block;
@@ -59,6 +57,9 @@
@include govuk-text-colour;
display: block;
padding-left: 45px;
+ // While `<strong>` is styled `bold` or `bolder` by user-agents
+ // this can be reset by the app's stylesheet
+ font-weight: inherit;
}
}
Action run for 87b7566 |
There's no guarantee browser defaults of `bold` or `bolder` have not been overriden so we need to set the font-weight explicitely. Closes #5279
romaricpascal
force-pushed
the
warning-text-font-weight
branch
from
September 17, 2024 14:16
9927286
to
5620565
Compare
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-5331
September 17, 2024 14:17
Inactive
romaricpascal
changed the title
Explicitely set Warning Text font weight
Fix Warning Text font weight when Sep 17, 2024
<strong>
styles are reset
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-5331
September 17, 2024 14:22
Inactive
owenatgov
approved these changes
Sep 17, 2024
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.
From testing, trying to set a font-weight at the strong
level is overrided by this, meaning it's working!
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
There's no guarantee browser defaults of
bold
orbolder
have not been overriden so we need to set the font-weight explicitely.Thoughts
Rather than reverting to having both the
.govuk-warning-text__icon
and.govuk-warning-text__text
each have afont-weight
(as they used to before v5.0.0), I took the opportunity to regroup the font configuration in.govuk-warning-text
and explicitely solve the problem thatstrong
may not have the right font-weight set.I think this clarifies intentions that 'we want this component to be in 19px bold' but
<strong>
gets in the way so we solve that particular issue.Closes #5279