-
Notifications
You must be signed in to change notification settings - Fork 592
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
Use button
CSS vars for border-color to support a feature flag
#3861
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2a6b08d
use css var for border with fallback
langermank 01f4ff2
storybook config
langermank ad47703
Create flat-oranges-tease.md
langermank 715d7d2
snaps
langermank 47b9d21
test(vrt): update snapshots
joshblack c6c2b0e
snippy snaps
langermank 7f75c53
Merge branch 'btn-border-contrast-tes' of https://github.com/primer/r…
langermank 5e244b5
update danger and outline
langermank File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/react": patch | ||
--- | ||
|
||
Use `button` CSS vars for border-color to support a feature flag |
Binary file modified
BIN
-11 Bytes
(100%)
...redSearch.test.ts-snapshots/FilteredSearch-Default-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-11 Bytes
(100%)
...Search.test.ts-snapshots/FilteredSearch-Playground-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+16 Bytes
(100%)
...t.ts-snapshots/InlineAutocomplete-Custom-Rendering-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+16 Bytes
(100%)
...plete.test.ts-snapshots/InlineAutocomplete-Default-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+18 Bytes
(100%)
...te.test.ts-snapshots/InlineAutocomplete-Playground-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+14 Bytes
(100%)
...e.test.ts-snapshots/InlineAutocomplete-Single-Line-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+18 Bytes
(100%)
...s/components/Select.test.ts-snapshots/Select-Block-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+18 Bytes
(100%)
...components/Select.test.ts-snapshots/Select-Default-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+20 Bytes
(100%)
...s/components/Select.test.ts-snapshots/Select-Large-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+26 Bytes
(100%)
...s/components/Select.test.ts-snapshots/Select-Small-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+24 Bytes
(100%)
...ect.test.ts-snapshots/Select-Visually-Hidden-Label-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+18 Bytes
(100%)
...nents/Select.test.ts-snapshots/Select-With-Caption-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+17 Bytes
(100%)
...Select.test.ts-snapshots/Select-With-Option-Groups-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+16 Bytes
(100%)
...onents/TextInput.test.ts-snapshots/TextInput-Block-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+21 Bytes
(100%)
...ents/TextInput.test.ts-snapshots/TextInput-Default-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+21 Bytes
(100%)
...onents/TextInput.test.ts-snapshots/TextInput-Large-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+21 Bytes
(100%)
...onents/TextInput.test.ts-snapshots/TextInput-Small-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+46 Bytes
(100%)
....test.ts-snapshots/TextInput-Visually-Hidden-Label-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+19 Bytes
(100%)
...TextInput.test.ts-snapshots/TextInput-With-Caption-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1 Byte
(100%)
...ut.test.ts-snapshots/TextInput-With-Leading-Visual-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+20 Bytes
(100%)
...t.test.ts-snapshots/TextInput-With-Trailing-Action-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+36 Bytes
(100%)
...put.test.ts-snapshots/TextInput-With-Trailing-Icon-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+96 Bytes
(100%)
...kens.test.ts-snapshots/TextInputWithTokens-Default-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+28 Bytes
(100%)
...-snapshots/TextInputWithTokens-With-Leading-Visual-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+97 Bytes
(100%)
...snapshots/TextInputWithTokens-With-Trailing-Visual-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+18 Bytes
(100%)
...mponents/Textarea.test.ts-snapshots/Textarea-Block-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+17 Bytes
(100%)
...onents/Textarea.test.ts-snapshots/Textarea-Default-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+50 Bytes
(100%)
...a.test.ts-snapshots/Textarea-Visually-Hidden-Label-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+27 Bytes
(100%)
...onents/Textarea.test.ts-snapshots/Textarea-Warning-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+18 Bytes
(100%)
...s/Textarea.test.ts-snapshots/Textarea-With-Caption-dark-high-contrast-linux.png
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,11 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme | |
boxShadow: `${theme?.shadows.btn.shadow}, ${theme?.shadows.btn.insetShadow}`, | ||
'&:hover:not([disabled])': { | ||
backgroundColor: 'btn.hoverBg', | ||
borderColor: 'btn.hoverBorder', | ||
borderColor: `var(--button-default-borderColor-hover, ${theme?.colors.btn.hoverBorder})`, | ||
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. ✅ has a fallback 10/10 |
||
}, | ||
'&:active:not([disabled])': { | ||
backgroundColor: 'btn.activeBg', | ||
borderColor: 'btn.activeBorder', | ||
borderColor: `var(--button-default-borderColor-active, ${theme?.colors.btn.activeBorder})`, | ||
}, | ||
'&:disabled': { | ||
color: 'primer.fg.disabled', | ||
|
@@ -23,7 +23,7 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme | |
}, | ||
'&[aria-expanded=true]': { | ||
backgroundColor: 'btn.activeBg', | ||
borderColor: 'btn.activeBorder', | ||
borderColor: `var(--button-default-borderColor-active, ${theme?.colors.btn.activeBorder})`, | ||
}, | ||
'[data-component="leadingVisual"], [data-component="trailingVisual"], [data-component="trailingAction"]': { | ||
color: `var(--button-color, ${theme?.colors.fg.muted})`, | ||
|
@@ -149,13 +149,13 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme | |
outline: { | ||
color: 'btn.outline.text', | ||
boxShadow: `${theme?.shadows.btn.shadow}`, | ||
borderColor: 'btn.border', | ||
borderColor: `var(--button-default-borderColor-rest, ${theme?.colors.btn.border})`, | ||
backgroundColor: 'btn.bg', | ||
|
||
'&:hover:not([disabled])': { | ||
color: 'btn.outline.hoverText', | ||
backgroundColor: 'btn.outline.hoverBg', | ||
borderColor: 'btn.outline.hoverBorder', | ||
borderColor: `${theme?.colors.btn.outline.hoverBorder}`, | ||
boxShadow: `${theme?.shadows.btn.outline.hoverShadow}`, | ||
'[data-component=ButtonCounter]': { | ||
backgroundColor: 'btn.outline.hoverCounterBg', | ||
|
@@ -166,7 +166,7 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme | |
color: 'btn.outline.selectedText', | ||
backgroundColor: 'btn.outline.selectedBg', | ||
boxShadow: `${theme?.shadows.btn.outline.selectedShadow}`, | ||
borderColor: 'btn.outline.selectedBorder', | ||
borderColor: `${theme?.colors.btn.outline.selectedBorder}`, | ||
}, | ||
|
||
'&:disabled': { | ||
|
@@ -186,7 +186,7 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme | |
color: 'btn.outline.selectedText', | ||
backgroundColor: 'btn.outline.selectedBg', | ||
boxShadow: `${theme?.shadows.btn.outline.selectedShadow}`, | ||
borderColor: 'btn.outline.selectedBorder', | ||
borderColor: `var(--button-default-borderColor-active, ${theme?.colors.btn.outline.selectedBorder})`, | ||
}, | ||
}, | ||
} | ||
|
@@ -196,7 +196,7 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme | |
export const getBaseStyles = (theme?: Theme) => ({ | ||
borderRadius: '2', | ||
border: '1px solid', | ||
borderColor: theme?.colors.btn.border, | ||
borderColor: `var(--button-default-borderColor-rest, ${theme?.colors.btn.border})`, | ||
fontFamily: 'inherit', | ||
fontWeight: 'semibold', | ||
fontSize: '1', | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ exports[`ActionMenu renders consistently 1`] = ` | |
.c1 { | ||
border-radius: 6px; | ||
border: 1px solid; | ||
border-color: rgba(31,35,40,0.15); | ||
border-color: var(--button-default-borderColor-rest,rgba(31,35,40,0.15)); | ||
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. ✅ makes sense, ActionMenu uses Button |
||
font-family: inherit; | ||
font-weight: 500; | ||
font-size: 14px; | ||
|
@@ -210,17 +210,17 @@ exports[`ActionMenu renders consistently 1`] = ` | |
|
||
.c1:hover:not([disabled]) { | ||
background-color: #f3f4f6; | ||
border-color: rgba(31,35,40,0.15); | ||
border-color: var(--button-default-borderColor-hover,rgba(31,35,40,0.15)); | ||
} | ||
|
||
.c1:active:not([disabled]) { | ||
background-color: hsla(220,14%,93%,1); | ||
border-color: rgba(31,35,40,0.15); | ||
border-color: var(--button-default-borderColor-active,rgba(31,35,40,0.15)); | ||
} | ||
|
||
.c1[aria-expanded=true] { | ||
background-color: hsla(220,14%,93%,1); | ||
border-color: rgba(31,35,40,0.15); | ||
border-color: var(--button-default-borderColor-active,rgba(31,35,40,0.15)); | ||
} | ||
|
||
.c1 [data-component="leadingVisual"], | ||
|
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 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.
do we want to keep these disabled in storybook?
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.
I'd like to add a toolbar addon to let you toggle them on, like how we have it in Primer View Components Lookbook
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.
Good idea, should we do that in a different PR though and get this one quickly?
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.
Yeah totally agree