-
Notifications
You must be signed in to change notification settings - Fork 934
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
Update banner settings and related mixins #3531
Merged
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
- Use currentColor for fill to interit text color - Use smarter icon sizing math - Explain magic numbers
mejiaj
reviewed
Jul 2, 2020
mejiaj
approved these changes
Jul 2, 2020
7 tasks
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.
This PR updates the banner settings to allow custom color for the background and link. It also allows developers to set the color of links against dark backgrounds.
"base-lightest"default"base-lighter""base-lightest""white"The component will adjust the text color of the banner (to either "white" or "ink" for proper AA contrast against the specified background. When
$theme-banner-link-colorisdefault, the link and icon will use the default link colors (either standard or reverse) or any color token set in$theme-banner-link-color. The system will throw an error if the custom color will not provide sufficient AA contrast against the specified background.The icon object
This PR introduces the concept of the icon object, a Sass map that contains metadata about USWDS icons. The icon object requires some specific icon file setup to function properly:
[name].svg. Ex:arrow.svg#000).[name]-[variant].svg. Ex:arrow-red-50v.svgred-warm-50vorgold-30white(#fff) icon variant. Ex:arrow-white.svg"name"[name]-[color-variant].svg"arrow.svg""svg-height"heightvalue found in the SVG image.9"svg-width"widthvalue found in the SVG image.16"height"0.8ex"color"nulldefaults to"ink"."primary""color-hover"nullthe icon color will not change on hover."primary-dark""color-variant"null, defaults to"white"."blue-60""container-height"nulldefaults tosvg-height.2"container-width"nulldefaults toicon height * svg-width / svg-height.2"rotate"XXdeg. If omitted ornull, no rotation.180deg"path"nulldefaults to$theme-image-path"../my-project/img"Example:
Mixins
add-color-icon()
$icon-arrow"white"Example:
place-icon()
Places an icon before or after an element as an inline-block, using the
:beforeor:afterpseudoelements.$icon-arrowbeforeorafter)"after"0.5middle"white"Functions
get-token-from-bg()
Returns a color token with proper WCAG contrast from two token options and a background.
"white""ink"AA,AAA, orAA-largeAAget-color-from-bg()
Returns a color hex with proper WCAG contrast from two token options and a background.
"white""ink"AA,AAA, orAA-largeAAget-link-tokens-from-bg()
Returns a two system color tokens (base link and hover) with proper WCAG contrast from two base link color token options and a background color.
$theme-link-color$theme-link-reverse-colorAA,AAA, orAA-largeAA