Skip to content
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

Merged
merged 12 commits into from
Mar 3, 2021

Conversation

VanAnderson
Copy link
Contributor

@VanAnderson VanAnderson commented Feb 25, 2021

This PR updates the following components to use functional color variables in preparation for color mode support:

  • SideNav
  • StateLabel
  • SubNav
  • TabNav

Part of https://github.com/github/design-systems/issues/1219

@vercel
Copy link

vercel bot commented Feb 25, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/primer/primer-components/AJeKKuWEf6DvgieoyKKNAP7MsReY
✅ Preview: https://primer-compone-git-vananderson-implement-functional-colo-639b39.vercel.app

@@ -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;
Copy link
Contributor Author

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.

Screen Shot 2021-02-25 at 11 31 52 AM

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?

@VanAnderson VanAnderson force-pushed the VanAnderson/implement-functional-color-vars branch from 40e0a12 to 327dc6f Compare February 26, 2021 16:06
@changeset-bot
Copy link

changeset-bot bot commented Feb 26, 2021

🦋 Changeset detected

Latest commit: b578a73

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/components Patch

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

@vercel vercel bot temporarily deployed to Preview February 26, 2021 16:06 Inactive
@@ -114,7 +114,7 @@ exports[`SubNav.Link renders consistently 1`] = `

.c0:hover .SubNav-octicon,
.c0:focus .SubNav-octicon {
color: #6a737d;
color: #586069;
Copy link
Contributor Author

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

@VanAnderson VanAnderson changed the title [WIP] implement functional color vars Implement functional color vars [SideNav, StateLabel, SubNav, TabNav, Link] Feb 26, 2021
@VanAnderson VanAnderson marked this pull request as ready for review February 26, 2021 16:11
src/Link.tsx Outdated Show resolved Hide resolved
@VanAnderson VanAnderson force-pushed the VanAnderson/implement-functional-color-vars branch from 327dc6f to 56bf18a Compare February 26, 2021 18:00
@VanAnderson VanAnderson changed the title Implement functional color vars [SideNav, StateLabel, SubNav, TabNav, Link] Implement functional color vars [SideNav, StateLabel, SubNav, TabNav] Feb 26, 2021
@vercel vercel bot temporarily deployed to Preview March 1, 2021 17:25 Inactive
@vercel vercel bot temporarily deployed to Preview March 1, 2021 17:28 Inactive
Copy link
Contributor

@colebemis colebemis left a 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;
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@vercel vercel bot temporarily deployed to Preview March 1, 2021 17:55 Inactive
@VanAnderson VanAnderson force-pushed the VanAnderson/implement-functional-color-vars branch from cefc1b6 to 1a33cf0 Compare March 2, 2021 17:20
@vercel vercel bot temporarily deployed to Preview March 2, 2021 17:20 Inactive
@VanAnderson
Copy link
Contributor Author

VanAnderson commented Mar 2, 2021

@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?

image

@vercel vercel bot temporarily deployed to Preview March 3, 2021 15:56 Inactive
})

const sizeVariants = variant({
prop: 'variant',
scale: 'stateLabels.sizes'
scale: 'stateLabels.sizes',
Copy link
Contributor

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

Suggested change
scale: 'stateLabels.sizes',

@@ -18,12 +18,54 @@ const octiconMap = {

const colorVariants = variant({
prop: 'status',
scale: 'stateLabels.status'
scale: 'stateLabels.status',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
scale: 'stateLabels.status',
scale: 'stateLabels.status',

@vercel vercel bot temporarily deployed to Preview March 3, 2021 16:05 Inactive
src/StateLabel.tsx Outdated Show resolved Hide resolved
src/StateLabel.tsx Outdated Show resolved Hide resolved
src/StateLabel.tsx Show resolved Hide resolved
src/StateLabel.tsx Outdated Show resolved Hide resolved
Co-authored-by: Cole Bemis <colebemis@github.com>
@vercel vercel bot temporarily deployed to Preview March 3, 2021 16:37 Inactive
src/SubNav.tsx Outdated Show resolved Hide resolved
src/SubNav.tsx Outdated Show resolved Hide resolved
src/SubNav.tsx Outdated Show resolved Hide resolved
Co-authored-by: Cole Bemis <colebemis@github.com>
@vercel vercel bot temporarily deployed to Preview March 3, 2021 17:01 Inactive
@vercel vercel bot temporarily deployed to Preview March 3, 2021 17:05 Inactive
Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Nice work!

@VanAnderson
Copy link
Contributor Author

@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

@colebemis colebemis merged commit 108c273 into main Mar 3, 2021
@colebemis colebemis deleted the VanAnderson/implement-functional-color-vars branch March 3, 2021 17:12
@github-actions github-actions bot mentioned this pull request Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants