Skip to content

Conversation

@langermank
Copy link
Contributor

@langermank langermank commented Jan 18, 2024

Closes https://github.com/github/primer/issues/2987

As a followup to moving the legacy theme files into Primer React from Primer Primitives, this PR introduces the new v8 color CSS vars with fallbacks as the value of the JS variables. This allows us to staff ship v8 variables without rewriting all of our CSS upfront. It also may help with the theme flashing issue.

Code review

This looks like a lot of changes (it is) but the thing we are most concerned about is if the raw value has changes. The easiest way to see that is to primarily review the lefthand side to see which values have changed. There are a few intentional changes:

  • sometimes rgba transparent becomes transparent
  • the fg muted color was updated in a newer Primitives release which is reflected here
  • random bug fixes
diff view

Changelog

  • Adds CSS variable color values to the legacy Primitive design tokens.
  • Three values include: the new v8 color CSS variable, a fallback of the old color CSS variable, and the raw value.

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

We'll definitely want to test this against dotcom with an integration test PR.

Merge checklist

@changeset-bot
Copy link

changeset-bot bot commented Jan 18, 2024

🦋 Changeset detected

Latest commit: fbc0e26

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

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 18, 2024

size-limit report 📦

Path Size
dist/browser.esm.js 113.83 KB (+8.96% 🔺)
dist/browser.umd.js 114.47 KB (+8.91% 🔺)

},
expander: {
icon: '#7d8590',
icon: 'var(--diffBlob-expander-iconColor, var(--color-diff-blob-expander-icon, #848d97))',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that these changes from 7d8590 to 848d97 are actually intended and correct ✅

@github-actions github-actions bot temporarily deployed to storybook-preview-4157 January 18, 2024 16:03 Inactive
@langermank langermank added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jan 18, 2024
@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jan 18, 2024
@primer primer bot temporarily deployed to github-pages January 18, 2024 16:16 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4157 January 18, 2024 16:17 Inactive
@langermank langermank added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jan 20, 2024
@github-actions github-actions bot temporarily deployed to storybook-preview-4157 January 20, 2024 01:01 Inactive
@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jan 20, 2024
@primer primer bot temporarily deployed to github-pages January 20, 2024 01:08 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4157 January 20, 2024 01:08 Inactive
@langermank langermank added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jan 22, 2024
@github-actions github-actions bot temporarily deployed to storybook-preview-4157 January 22, 2024 17:53 Inactive
@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jan 22, 2024
@github-actions github-actions bot temporarily deployed to storybook-preview-4157 January 22, 2024 18:03 Inactive
@langermank langermank marked this pull request as ready for review January 22, 2024 18:33
@langermank langermank requested review from a team and joshblack January 22, 2024 18:33
inputPlaceholderText: '#6e7681',
inputFocusText: '#e6edf3',
inputBg: '#161b22',
inputShadow: '0 0 0 1px (obj) => (0, get_1.default)(obj, path)',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has been broken for awhile, I replaced it with the correct value

Copy link
Member

@joshblack joshblack left a comment

Choose a reason for hiding this comment

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

LGTM! 🥳 I had two broader questions as it relates to this PR:

  • Is there any potential impact as it relates to how folks use themeGet? It seems like most people just use it to get a value versus interacting with it so seems like it should be good?
  • What's the best way for us to test this out in dotcom to make sure we're confident no styling issues make their way into a release?

@langermank langermank added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jan 25, 2024
@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jan 25, 2024
@langermank langermank added this pull request to the merge queue Jan 25, 2024
Merged via the queue into main with commit aafa257 Jan 25, 2024
@langermank langermank deleted the css-var-color-tokens branch January 25, 2024 23:06
@primer primer bot mentioned this pull request Jan 25, 2024
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.

3 participants