-
Notifications
You must be signed in to change notification settings - Fork 625
Add support for high contrast themes to ProgressBar
#6431
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
Changes from all commits
db36080
a55ba21
557680d
229650d
cc15870
cb5c240
1e27122
de49660
d16a257
c539fbb
8a6dcac
ebd9480
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/react": patch | ||
--- | ||
|
||
Add `border` and `background-color` tokens to `ProgressBar` CSS, which increases contrast for high contrast themes |
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -33,6 +33,7 @@ export const Item = forwardRef<HTMLSpanElement, ProgressBarItems>( | |||||
'aria-valuetext': ariaValueText, | ||||||
className, | ||||||
style, | ||||||
bg, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
...rest | ||||||
}, | ||||||
forwardRef, | ||||||
|
@@ -51,9 +52,10 @@ export const Item = forwardRef<HTMLSpanElement, ProgressBarItems>( | |||||
const progressBarBg = '--progress-bg' | ||||||
const styles: {[key: string]: string} = {} | ||||||
|
||||||
const bgType = rest.bg && rest.bg.split('.') | ||||||
const bgType = bg && bg.split('.') | ||||||
styles[progressBarWidth] = progress ? `${progress}%` : '0%' | ||||||
styles[progressBarBg] = (bgType && `var(--bgColor-${bgType[0]}-${bgType[1]})`) || 'var(--bgColor-success-emphasis)' | ||||||
styles[progressBarBg] = | ||||||
(bgType && `var(--bgColor-${bgType[0]}-${bgType[1] || 'emphasis'})`) || 'var(--bgColor-success-emphasis)' | ||||||
|
||||||
return ( | ||||||
<BoxWithFallback | ||||||
|
This file was deleted.
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.
The bg prop value should be 'sponsor.emphasis' not 'sponsors.emphasis' based on the pattern used in other color variants.
Copilot uses AI. Check for mistakes.