-
Notifications
You must be signed in to change notification settings - Fork 535
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
Implement functional color vars [SideNav, StateLabel, SubNav, TabNav] #1085
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/primer/primer-components/AJeKKuWEf6DvgieoyKKNAP7MsReY |
@@ -87,7 +87,7 @@ exports[`SideNav SideNav.Link renders consistently 1`] = ` | |||
|
|||
.c1.variant-normal > .c0[aria-current='page']::before, | |||
.c1.variant-normal > .c0[aria-selected='true']::before { | |||
background-color: #f66a0a; | |||
background-color: #f9826c; |
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.
Wasn't quite sure if this was okay or not - my understanding was that implementing these functional color variables would not change the presentation.
This change comes from using colors.sidenav.borderActive
which seems like the obvious functional choice here and is very close to the original color. Thoughts on what we should do here?
40e0a12
to
327dc6f
Compare
🦋 Changeset detectedLatest commit: b578a73 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -114,7 +114,7 @@ exports[`SubNav.Link renders consistently 1`] = ` | |||
|
|||
.c0:hover .SubNav-octicon, | |||
.c0:focus .SubNav-octicon { | |||
color: #6a737d; | |||
color: #586069; |
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.
shift to colors.icon.secondary - changes by 1 shade
327dc6f
to
56bf18a
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.
Looking good! StateLabel needs a few updates to match the Primer CSS implementation.
@@ -38,7 +38,7 @@ const StateLabelBase = styled.span<StyledStateLabelBaseProps>` | |||
align-items: center; |
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.
StateLabel has variants that will need to be moved into this file. You can use https://github.com/primer/css/blob/mkt/color-modes-whee/src/labels/states.scss as an implementation reference.
Here's documentation on how to create variants with styled system: https://styled-system.com/variants
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.
done!
cefc1b6
to
1a33cf0
Compare
@colebemis I think you commented out the default theme for sidenav and it might be causing this test to fail. Should I remove the test? |
src/StateLabel.tsx
Outdated
}) | ||
|
||
const sizeVariants = variant({ | ||
prop: 'variant', | ||
scale: 'stateLabels.sizes' | ||
scale: 'stateLabels.sizes', |
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 don't think this line is necessary anymore
scale: 'stateLabels.sizes', |
src/StateLabel.tsx
Outdated
@@ -18,12 +18,54 @@ const octiconMap = { | |||
|
|||
const colorVariants = variant({ | |||
prop: 'status', | |||
scale: 'stateLabels.status' | |||
scale: 'stateLabels.status', |
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.
scale: 'stateLabels.status', | |
scale: 'stateLabels.status', |
Co-authored-by: Cole Bemis <colebemis@github.com>
Co-authored-by: Cole Bemis <colebemis@github.com>
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.
🎉 Nice work!
@colebemis thanks for the assist on SubNav there - I think this first one was before I fully understood how to pull over the right vars from mkt/color-modes-whee |
This PR updates the following components to use functional color variables in preparation for color mode support:
Part of https://github.com/github/design-systems/issues/1219