-
Notifications
You must be signed in to change notification settings - Fork 150
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
USWDS-Site - Banner: Remove duplicated styles so banner highlight shows completely on tab. #2743
base: main
Are you sure you want to change the base?
Conversation
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.
@cathybaptista Great start here Cathy! I left a couple change requests based on some regressions I noticed as well as additional styles we can remove.
I also have a question about the scope of the issue. Does this issue aim to address all duplicate styles in _uswds-theme-custom-styles.scss
? Or is it scoped specifically to banner styles? If it's scoped to banner styles, should we address the additional duplications or are we primarily focusing on banner button?
In either case it look like there are additional styles we can potentially remove.
CC: @mejiaj since he is the issue submitter
From the issue:
Sounds like we look at the additional banner classes with potential duplicate styles, such as Footnotes |
@mahoneycm , I was able to remove many styles. Here is the list. I have checked that these removals don't cause any problems that I can see, but I would love a more experienced eye on this just to be 100% sure I didn't remove a style that is causing issues. SOOO many thanks! .usa-banner__icon |
9c7c0bc
to
e085c99
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.
Hey there @cathybaptista! Getting closer. It looks like there are additional duplicate styles that we can remove. I tagged some that stood out to me.
Would you mind ensuring we can safely remove these and giving this another pass to see if there are additional styles that are safe to remove?
min-height: 0; | ||
} | ||
} | ||
|
||
.usa-banner__header-text { | ||
@include u-margin-y(0); |
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.
Suggestion: Removing this margin does cause any regression of styles. Margin is set to 0 in banner styles lines 157-158.
@include u-margin-y(0); |
@@ -2906,11 +2840,6 @@ $theme-table-column-gap: 4; | |||
middle, | |||
$site-banner-background-color | |||
); |
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.
Note: These styles are required to maintain proper color contrast of the chevron in mobile views
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.
Chore: Run npm run prettier:scss
. This will help to cleanup some white space and minor formatting issues 👍
} | ||
|
||
&[aria-expanded="false"] { | ||
background-image: none; | ||
} | ||
|
||
&[aria-expanded="true"] { | ||
background-image: none; |
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.
Suggestion: We can remove the background-image here. It's declared in banner styles lines 286-290
background-image: none; |
@include u-pin("right"); | ||
} | ||
} | ||
|
||
@include at-media("tablet") { |
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.
Suggestion: I'm unable to tag the correct lines because they are unedited but it looks like we can safely remove lines 2881-2887.
- height: auto;
- padding: units(0);
- position: relative;
- &:after {
- position: absolute;
- }
These are set in banner styles lines 332-338
$site-banner-background-color, | ||
$site-banner-link-color, | ||
$context: $banner-context | ||
); | ||
|
||
line-height: line-height($site-banner-font-family, 2); | ||
margin-bottom: units(0); |
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.
Suggestion: Remove lines 2845-2855. Unable mark as a code suggestion due to unchanged lines.
- margin-bottom: units(0);
- margin-top: units(2px);
- text-decoration: underline;
- .usa-banner__header--expanded & {
- display: none;
- }
- @include at-media("tablet") {
- display: none;
- }
Maintained by banner styles lines 172-182
Summary
Removed duplicate styles for
.usa-banner__button
from uswds-site that were also in uswds. Now, the banner appears with the highlight on all four sides when the user tabs to the banner.Related issue
Closes #1962
Preview link
home page
Problem statement
This issue relates to being able to test issue #5013 (https://github.com/uswds/uswds/pull/5013)](jhancock532:banner-focus-outline-styles).
#1962 was opened to resolve duplicated styles in uswds-site vs uswds that were causing the banner focus to only appear on 1 side for mobile devices. Ideally, the banner focus appears on all sides.
Rendering only an underline border on focus causes confusion to users with vision difficulties who have scaled the page to 400% zoom.
Solution
Before:
After:
Remove duplicate styles in uswds-site that also appear in uswds so that the correct style is shown and not overridden.
This approach was chosen because there is no need to have those duplicate styles in uswds-site when they are already in uswds, especially if they cause issues.
Testing and review
To reproduce: