USWDS - Banner: Support simplified icon markup using SVG mask#5829
Closed
aduth wants to merge 1 commit intouswds:developfrom
Closed
USWDS - Banner: Support simplified icon markup using SVG mask#5829aduth wants to merge 1 commit intouswds:developfrom
aduth wants to merge 1 commit intouswds:developfrom
Conversation
Contributor
|
Thanks for submitting this. For additional context, this icon was originally added in Update banner settings and related mixins - #3531. This icon is used between the parenthesis in Banner content (orange outline for visibility) |
Contributor
Author
Contributor
|
@aduth For right now, we're not proceeding with changes that might introduce a breaking change in the current banner. We're putting our focus into a Web Components version of the banner that we hope to release as a stable Beta in July. |
Contributor
Author
|
For posterity's sake, clarifying that there are no breaking changes with this proposal. |
mejiaj
pushed a commit
to uswds/uswds-elements
that referenced
this pull request
Sep 4, 2024
Following pattern from uswds/uswds#5829.
This file contains hidden or 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
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.

Summary
The Banner component markup has been simplified. The banner component no longer includes an embedded icon image, which is instead rendered as part of banner styles.
Breaking change
This is not a breaking change.
While this does change how the existing element is styled, this has been tested and confirmed support for a site which chooses to update to the newest styles while keeping the same HTML markup, and there is no observed visual regression.
Preview link
Preview link: http://localhost:6006/?path=/story/components-banner--default
Problem statement
Ideally, USWDS provides code snippets which are concise and easy to implement, do not needlessly duplicate existing resources, and are not at risk of falling out of sync with said resources.
Solution
Reference the existing
lock.svgimage CSS background mask, similar to what's done elsewhere in the banner with the "Here's how you know" expanding caret.Benefits:
icon-lockwrapping elementTesting and review
Review at preview link: http://localhost:6006/?path=/story/components-banner--default
To confirm backwards-compatibility, reset markup of
.twigfile todevelopbranch and observe no visual regressions even with updated styling: