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

Name fix #686

Merged
merged 1 commit into from
Jul 13, 2023
Merged

Name fix #686

merged 1 commit into from
Jul 13, 2023

Conversation

lukasoppermann
Copy link
Contributor

Summary

Renamed token: treeViewItem-leadingVisual-bgColor-rest to treeViewItem-leadingVisual-iconColor-rest

@lukasoppermann lukasoppermann requested a review from a team as a code owner July 13, 2023 07:11
@changeset-bot
Copy link

changeset-bot bot commented Jul 13, 2023

🦋 Changeset detected

Latest commit: b762926

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

This PR includes changesets to release 1 package
Name Type
@primer/primitives 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

@lukasoppermann lukasoppermann requested review from mperrotti and langermank and removed request for tobiasahlin and siddharthkp July 13, 2023 07:11
@github-actions
Copy link
Contributor

github-actions bot commented Jul 13, 2023

Variables changed
No variables changed

@github-actions
Copy link
Contributor

github-actions bot commented Jul 13, 2023

Design Token Diff

/css/functional/themes/dark-colorblind.css

+++ /home/runner/work/primitives/primitives/tokens-next-private/css/functional/themes/dark-colorblind.css	2023-07-13 12:27:46.754200667 +0000
@@ -180,7 +180,7 @@
 --selectMenu-bgColor-active: #0c2d6b;
 --sideNav-bgColor-selected: #21262d;
 --timelineBadge-bgColor: #21262d;
-  --treeViewItem-leadingVisual-bgColor-rest: #7d8590;
+  --treeViewItem-leadingVisual-iconColor-rest: #7d8590;
 --underlineNav-borderColor-active: #f78166;
 --underlineNav-borderColor-hover: #6e768166;
 --underlineNav-iconColor-rest: #7d8590;
@@ -581,7 +581,7 @@
   --selectMenu-bgColor-active: #0c2d6b;
   --sideNav-bgColor-selected: #21262d;
   --timelineBadge-bgColor: #21262d;
-    --treeViewItem-leadingVisual-bgColor-rest: #7d8590;
+    --treeViewItem-leadingVisual-iconColor-rest: #7d8590;
   --underlineNav-borderColor-active: #f78166;
   --underlineNav-borderColor-hover: #6e768166;
   --underlineNav-iconColor-rest: #7d8590;

/css/functional/themes/dark-dimmed.css

+++ /home/runner/work/primitives/primitives/tokens-next-private/css/functional/themes/dark-dimmed.css	2023-07-13 12:27:46.090187121 +0000
@@ -180,7 +180,7 @@
 --selectMenu-bgColor-active: #143d79;
 --sideNav-bgColor-selected: #373e47;
 --timelineBadge-bgColor: #373e47;
-  --treeViewItem-leadingVisual-bgColor-rest: #6d7986;
+  --treeViewItem-leadingVisual-iconColor-rest: #6d7986;
 --underlineNav-borderColor-active: #ec775c;
 --underlineNav-borderColor-hover: #636e7b66;
 --underlineNav-iconColor-rest: #6d7986;
@@ -581,7 +581,7 @@
   --selectMenu-bgColor-active: #143d79;
   --sideNav-bgColor-selected: #373e47;
   --timelineBadge-bgColor: #373e47;
-    --treeViewItem-leadingVisual-bgColor-rest: #6d7986;
+    --treeViewItem-leadingVisual-iconColor-rest: #6d7986;
   --underlineNav-borderColor-active: #ec775c;
   --underlineNav-borderColor-hover: #636e7b66;
   --underlineNav-iconColor-rest: #6d7986;

/css/functional/themes/dark-high-contrast.css

+++ /home/runner/work/primitives/primitives/tokens-next-private/css/functional/themes/dark-high-contrast.css	2023-07-13 12:27:47.086207314 +0000
@@ -180,7 +180,7 @@
 --selectMenu-bgColor-active: #1e60d5;
 --sideNav-bgColor-selected: #272b33;
 --timelineBadge-bgColor: #272b33;
-  --treeViewItem-leadingVisual-bgColor-rest: #f0f3f6;
+  --treeViewItem-leadingVisual-iconColor-rest: #f0f3f6;
 --underlineNav-borderColor-active: #ff967d;
 --underlineNav-borderColor-hover: #bdc4cc;
 --underlineNav-iconColor-rest: #f0f3f6;
@@ -581,7 +581,7 @@
   --selectMenu-bgColor-active: #1e60d5;
   --sideNav-bgColor-selected: #272b33;
   --timelineBadge-bgColor: #272b33;
-    --treeViewItem-leadingVisual-bgColor-rest: #f0f3f6;
+    --treeViewItem-leadingVisual-iconColor-rest: #f0f3f6;
   --underlineNav-borderColor-active: #ff967d;
   --underlineNav-borderColor-hover: #bdc4cc;
   --underlineNav-iconColor-rest: #f0f3f6;

/css/functional/themes/dark-tritanopia.css

+++ /home/runner/work/primitives/primitives/tokens-next-private/css/functional/themes/dark-tritanopia.css	2023-07-13 12:27:46.426194091 +0000
@@ -180,7 +180,7 @@
 --selectMenu-bgColor-active: #0c2d6b;
 --sideNav-bgColor-selected: #21262d;
 --timelineBadge-bgColor: #21262d;
-  --treeViewItem-leadingVisual-bgColor-rest: #7d8590;
+  --treeViewItem-leadingVisual-iconColor-rest: #7d8590;
 --underlineNav-borderColor-active: #f78166;
 --underlineNav-borderColor-hover: #6e768166;
 --underlineNav-iconColor-rest: #7d8590;
@@ -581,7 +581,7 @@
   --selectMenu-bgColor-active: #0c2d6b;
   --sideNav-bgColor-selected: #21262d;
   --timelineBadge-bgColor: #21262d;
-    --treeViewItem-leadingVisual-bgColor-rest: #7d8590;
+    --treeViewItem-leadingVisual-iconColor-rest: #7d8590;
   --underlineNav-borderColor-active: #f78166;
   --underlineNav-borderColor-hover: #6e768166;
   --underlineNav-iconColor-rest: #7d8590;

/css/functional/themes/dark.css

+++ /home/runner/work/primitives/primitives/tokens-next-private/css/functional/themes/dark.css	2023-07-13 12:27:45.726179571 +0000
@@ -180,7 +180,7 @@
 --selectMenu-bgColor-active: #0c2d6b;
 --sideNav-bgColor-selected: #21262d;
 --timelineBadge-bgColor: #21262d;
-  --treeViewItem-leadingVisual-bgColor-rest: #7d8590;
+  --treeViewItem-leadingVisual-iconColor-rest: #7d8590;
 --underlineNav-borderColor-active: #f78166;
 --underlineNav-borderColor-hover: #6e768166;
 --underlineNav-iconColor-rest: #7d8590;
@@ -581,7 +581,7 @@
   --selectMenu-bgColor-active: #0c2d6b;
   --sideNav-bgColor-selected: #21262d;
   --timelineBadge-bgColor: #21262d;
-    --treeViewItem-leadingVisual-bgColor-rest: #7d8590;
+    --treeViewItem-leadingVisual-iconColor-rest: #7d8590;
   --underlineNav-borderColor-active: #f78166;
   --underlineNav-borderColor-hover: #6e768166;
   --underlineNav-iconColor-rest: #7d8590;

/css/functional/themes/light-colorblind.css

+++ /home/runner/work/primitives/primitives/tokens-next-private/css/functional/themes/light-colorblind.css	2023-07-13 12:27:44.926162977 +0000
@@ -181,7 +181,7 @@
 --selectMenu-bgColor-active: #b6e3ff;
 --sideNav-bgColor-selected: #ffffff;
 --timelineBadge-bgColor: #eaeef2;
-  --treeViewItem-leadingVisual-bgColor-rest: #54aeff;
+  --treeViewItem-leadingVisual-iconColor-rest: #54aeff;
 --underlineNav-borderColor-active: #fd8c73;
 --underlineNav-borderColor-hover: #afb8c133;
 --underlineNav-iconColor-rest: #636c76;
@@ -582,7 +582,7 @@
   --selectMenu-bgColor-active: #b6e3ff;
   --sideNav-bgColor-selected: #ffffff;
   --timelineBadge-bgColor: #eaeef2;
-    --treeViewItem-leadingVisual-bgColor-rest: #54aeff;
+    --treeViewItem-leadingVisual-iconColor-rest: #54aeff;
   --underlineNav-borderColor-active: #fd8c73;
   --underlineNav-borderColor-hover: #afb8c133;
   --underlineNav-iconColor-rest: #636c76;

/css/functional/themes/light-high-contrast.css

+++ /home/runner/work/primitives/primitives/tokens-next-private/css/functional/themes/light-high-contrast.css	2023-07-13 12:27:45.358171938 +0000
@@ -181,7 +181,7 @@
 --selectMenu-bgColor-active: #9cd7ff;
 --sideNav-bgColor-selected: #ffffff;
 --timelineBadge-bgColor: #e7ecf0;
-  --treeViewItem-leadingVisual-bgColor-rest: #368cf9;
+  --treeViewItem-leadingVisual-iconColor-rest: #368cf9;
 --underlineNav-borderColor-active: #cd3425;
 --underlineNav-borderColor-hover: #88929d;
 --underlineNav-iconColor-rest: #0e1116;
@@ -582,7 +582,7 @@
   --selectMenu-bgColor-active: #9cd7ff;
   --sideNav-bgColor-selected: #ffffff;
   --timelineBadge-bgColor: #e7ecf0;
-    --treeViewItem-leadingVisual-bgColor-rest: #368cf9;
+    --treeViewItem-leadingVisual-iconColor-rest: #368cf9;
   --underlineNav-borderColor-active: #cd3425;
   --underlineNav-borderColor-hover: #88929d;
   --underlineNav-iconColor-rest: #0e1116;

/css/functional/themes/light-tritanopia.css

+++ /home/runner/work/primitives/primitives/tokens-next-private/css/functional/themes/light-tritanopia.css	2023-07-13 12:27:44.438152854 +0000
@@ -181,7 +181,7 @@
 --selectMenu-bgColor-active: #b6e3ff;
 --sideNav-bgColor-selected: #ffffff;
 --timelineBadge-bgColor: #eaeef2;
-  --treeViewItem-leadingVisual-bgColor-rest: #54aeff;
+  --treeViewItem-leadingVisual-iconColor-rest: #54aeff;
 --underlineNav-borderColor-active: #fd8c73;
 --underlineNav-borderColor-hover: #afb8c133;
 --underlineNav-iconColor-rest: #636c76;
@@ -582,7 +582,7 @@
   --selectMenu-bgColor-active: #b6e3ff;
   --sideNav-bgColor-selected: #ffffff;
   --timelineBadge-bgColor: #eaeef2;
-    --treeViewItem-leadingVisual-bgColor-rest: #54aeff;
+    --treeViewItem-leadingVisual-iconColor-rest: #54aeff;
   --underlineNav-borderColor-active: #fd8c73;
   --underlineNav-borderColor-hover: #afb8c133;
   --underlineNav-iconColor-rest: #636c76;

/css/functional/themes/light.css

+++ /home/runner/work/primitives/primitives/tokens-next-private/css/functional/themes/light.css	2023-07-13 12:27:43.518133771 +0000
@@ -181,7 +181,7 @@
 --selectMenu-bgColor-active: #b6e3ff;
 --sideNav-bgColor-selected: #ffffff;
 --timelineBadge-bgColor: #eaeef2;
-  --treeViewItem-leadingVisual-bgColor-rest: #54aeff;
+  --treeViewItem-leadingVisual-iconColor-rest: #54aeff;
 --underlineNav-borderColor-active: #fd8c73;
 --underlineNav-borderColor-hover: #afb8c133;
 --underlineNav-iconColor-rest: #636c76;
@@ -582,7 +582,7 @@
   --selectMenu-bgColor-active: #b6e3ff;
   --sideNav-bgColor-selected: #ffffff;
   --timelineBadge-bgColor: #eaeef2;
-    --treeViewItem-leadingVisual-bgColor-rest: #54aeff;
+    --treeViewItem-leadingVisual-iconColor-rest: #54aeff;
   --underlineNav-borderColor-active: #fd8c73;
   --underlineNav-borderColor-hover: #afb8c133;
   --underlineNav-iconColor-rest: #636c76;

@lukasoppermann lukasoppermann temporarily deployed to github-pages July 13, 2023 07:13 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview July 13, 2023 07:14 Inactive
@lukasoppermann lukasoppermann added skip changeset Apply to PRs that should not result in a version bump. and removed skip changeset Apply to PRs that should not result in a version bump. labels Jul 13, 2023
@lukasoppermann lukasoppermann temporarily deployed to github-pages July 13, 2023 12:23 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview July 13, 2023 12:23 Inactive
@lukasoppermann lukasoppermann temporarily deployed to github-pages July 13, 2023 12:29 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview July 13, 2023 12:29 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview July 13, 2023 12:29 Inactive
@lukasoppermann lukasoppermann merged commit 40fdf5c into main Jul 13, 2023
@lukasoppermann lukasoppermann deleted the name-fix branch July 13, 2023 12:42
@primer-css primer-css mentioned this pull request Jul 13, 2023
ktravers added a commit to primer/react that referenced this pull request Nov 13, 2024
For the directory icon color, [previously, we were using](https://github.com/primer/react/blob/21adedbc95e39a1b62ca2e0c31e87ac81e11911b/packages/react/src/TreeView/TreeView.module.css#L211):
```
var(--treeViewItem-leadingVisual-bgColor-rest, var(--color-tree-view-item-chevron-directory-fill, #CUSTOM_FALLBACK_FOR_EACH_MODE))
```

`--treeViewItem-leadingVisual-bgColor-rest` was replaced by `--treeViewItem-leadingVisual-iconColor-rest`
in primer/primitives#686. When that replacement was made, we didn't update the
legacy theme in this repo (makes sense), so since that variable no longer existed, we always use the
fallback hex code.

With these changes, we're now using `--treeViewItem-leadingVisual-iconColor-rest`. That variable works
for all modes except dark high contrast. I believe this is because whatever
[hex code that variable represents in dark high contrast mode](https://github.com/primer/primitives/blob/9f1033462619f7a3e3a191dcfc0a50cf7708c79a/src/tokens/functional/color/dark/patterns-dark.json5#L2081)
(#b7bdc8) is different than [this repo's custom legacy theme dark high contrast hex code](https://github.com/primer/react/blob/21adedbc95e39a1b62ca2e0c31e87ac81e11911b/packages/react/src/legacy-theme/ts/color-schemes.ts#L3535)
(#f0f3f6).

As a workaround, I've added this workaround for dark high contrast mode specifically.

We should implement a more robust solution in the future, either updating
`--treeViewItem-leadingVisual-iconColor-rest` to support the expected color
for dark high contrast mode, or updating the expected color to match the current
dark high contrast mode color.
github-merge-queue bot pushed a commit to primer/react that referenced this pull request Nov 14, 2024
* replace sx with Primer CSS utility classes where possible

As of https://github.com/primer/react/blob/fca4ec98f2e3ef5e5c3298320e3ab2050593709c/contributor-docs/adrs/adr-016-css.md,
Primer has decided to move away from using styled system props and prefers CSS for
styling over styled system props due to performance concerns with `sx` props.

See linked ADR for full details.

* add support for style prop to TreeView Root

* Convert ul to css modules

Per instructions:
https://github.com/primer/react/blob/ac6ddcd4b15526dd6f5ad6072a4daa57087eb1e7/contributor-docs/migrating-to-css-modules.md

* Reference CSS module classnames

* update skeleton components to use css modules

* add test for className support

* add changeset

* auto fix with 'npm run lint:css:fix'

* fix syntax for multiple modules classes

* update variable to prevent regression test failures

* workaround for directory icon color

For the directory icon color, [previously, we were using](https://github.com/primer/react/blob/21adedbc95e39a1b62ca2e0c31e87ac81e11911b/packages/react/src/TreeView/TreeView.module.css#L211):
```
var(--treeViewItem-leadingVisual-bgColor-rest, var(--color-tree-view-item-chevron-directory-fill, #CUSTOM_FALLBACK_FOR_EACH_MODE))
```

`--treeViewItem-leadingVisual-bgColor-rest` was replaced by `--treeViewItem-leadingVisual-iconColor-rest`
in primer/primitives#686. When that replacement was made, we didn't update the
legacy theme in this repo (makes sense), so since that variable no longer existed, we always use the
fallback hex code.

With these changes, we're now using `--treeViewItem-leadingVisual-iconColor-rest`. That variable works
for all modes except dark high contrast. I believe this is because whatever
[hex code that variable represents in dark high contrast mode](https://github.com/primer/primitives/blob/9f1033462619f7a3e3a191dcfc0a50cf7708c79a/src/tokens/functional/color/dark/patterns-dark.json5#L2081)
(#b7bdc8) is different than [this repo's custom legacy theme dark high contrast hex code](https://github.com/primer/react/blob/21adedbc95e39a1b62ca2e0c31e87ac81e11911b/packages/react/src/legacy-theme/ts/color-schemes.ts#L3535)
(#f0f3f6).

As a workaround, I've added this workaround for dark high contrast mode specifically.

We should implement a more robust solution in the future, either updating
`--treeViewItem-leadingVisual-iconColor-rest` to support the expected color
for dark high contrast mode, or updating the expected color to match the current
dark high contrast mode color.

* use `where` with attribute selector

Co-authored-by: Jon Rohan <yes@jonrohan.codes>

* use up-to-date color variable

Co-authored-by: Katie Langerman <18661030+langermank@users.noreply.github.com>

* Use `where` with attr selectors

Co-authored-by: Jon Rohan <yes@jonrohan.codes>

* drop PRIVATE_ prefix from css module classnames

* Remove unnecessary workaround for dark high contrast mode

Variable problem referenced in e97cf72
was resolved by #5277.

* test(vrt): update snapshots

---------

Co-authored-by: Jon Rohan <yes@jonrohan.codes>
Co-authored-by: Katie Langerman <18661030+langermank@users.noreply.github.com>
Co-authored-by: langermank <langermank@users.noreply.github.com>
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.

1 participant