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

fix(color-modes): properly use print mode even if its name is initialColorModeName #2090

Merged
merged 1 commit into from Mar 21, 2022

Conversation

hasparus
Copy link
Member

@hasparus hasparus commented Jan 21, 2022

Fixes #1964.

πŸ“¦ Published PR as canary version: 0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0

✨ Test out this PR locally via:

npm install @theme-ui/color-modes@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/color@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/components@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/core@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/css@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/custom-properties@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/editor@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install gatsby-plugin-theme-ui@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install gatsby-theme-style-guide@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install gatsby-theme-ui-layout@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/match-media@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/mdx@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/parse-props@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/preset-base@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/preset-bootstrap@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/preset-bulma@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/preset-dark@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/preset-deep@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/preset-funk@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/preset-future@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/preset-polaris@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/preset-roboto@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/preset-sketchy@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/preset-swiss@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/preset-system@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/preset-tailwind@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/preset-tosh@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/presets@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/prism@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/sidenav@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/style-guide@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/tailwind@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/theme-provider@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install theme-ui@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
npm install @theme-ui/typography@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
# or 
yarn add @theme-ui/color-modes@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/color@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/components@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/core@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/css@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/custom-properties@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/editor@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add gatsby-plugin-theme-ui@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add gatsby-theme-style-guide@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add gatsby-theme-ui-layout@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/match-media@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/mdx@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/parse-props@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/preset-base@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/preset-bootstrap@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/preset-bulma@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/preset-dark@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/preset-deep@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/preset-funk@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/preset-future@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/preset-polaris@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/preset-roboto@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/preset-sketchy@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/preset-swiss@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/preset-system@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/preset-tailwind@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/preset-tosh@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/presets@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/prism@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/sidenav@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/style-guide@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/tailwind@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/theme-provider@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add theme-ui@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0
yarn add @theme-ui/typography@0.14.0--canary.2090.55a1fbfa47decd8d745779790d9eb48a1efb60e6.0

Version

Published prerelease version: v0.14.0-develop.23

Changelog

πŸŽ‰ This release contains work from new contributors! πŸŽ‰

Thanks for all your work!

❀️ Brage (@braaar)

❀️ peterlits zo (@PeterlitsZo)

❀️ Ryan Turner (@rtturner)

❀️ Cannon Lock (@CannonLock)

πŸš€ Enhancement

  • feat(examples/next): Add new deps, fully use TSX, rebuild #2068 (@lachlanjc)
  • @theme-ui/tailwind
    • feat(tailwind): Upgrade Tailwind theme conversion for v3.0 #2082 (@lachlanjc)
  • @theme-ui/custom-properties
    • feat(custom-properties): Warn in development on invalid theme keys #2080 (@lachlanjc)
  • @theme-ui/color-modes
    • feat(color-modes): Warn when theme color keys have leading/trailing whitespace #2099 (@lachlanjc)
  • theme-ui

πŸ› Bug Fix

πŸ‘¨β€πŸ’» Minor changes

  • Update jsx-pragma.mdx (@hasparus)
  • docs(examples/next): fix case insensitive import (@hasparus)

🏠 Internal

Authors: 9

@vercel
Copy link

vercel bot commented Jan 21, 2022

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/systemui/theme-ui/5Jv3Pb6vWZMwQ9WX1QV1EGpxCQev
βœ… Preview: https://theme-ui-git-printmode-fix-systemui.vercel.app

text: '#fff',
background: '#000',
modes: {
light: {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a theme after mutation. Previous code assumed initial color mode is always at the root.

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 154a971:

Sandbox Source
next-theme-ui-example Configuration
gatsby-plugin-theme-ui-example Configuration

@hasparus hasparus marked this pull request as draft January 21, 2022 18:28
@hasparus
Copy link
Member Author

Hey @lachlanjc, could you give it a longer look? It's working locally for me, and the test I wrote seems to capture the problem, but it seems to be still broken in CodeSandbox CI examples :c

@hasparus hasparus marked this pull request as ready for review January 21, 2022 18:46
@hasparus hasparus merged commit f20e2ba into develop Mar 21, 2022
@hasparus hasparus deleted the printmode-fix branch March 21, 2022 11:47
@hasparus hasparus added the prerelease This change is available in a prerelease. label Mar 21, 2022
@hasparus
Copy link
Member Author

πŸš€ PR was released in v0.14.0 πŸš€

@hasparus hasparus added released This issue/pull request has been released. and removed prerelease This change is available in a prerelease. labels Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

color-modes: printColorModeName option not working properly
1 participant