You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What does the name mean? The name feels obscure. How about we rename it to something more explicit? Looking at the source, it seems to be close to a getColorSchemeSelector so maybe the name should be merged. Now, I imagine we shouldn't confuse it with the helper developer would use to write conditional logic, e.g. theme.applyStyles('dark', {}).
I don't resonate with the API shape. I would expect 90% of the people not to use the media query approach. I mean, I would personally always make this selectors-based, media query is for the reallllllly quick and dirty websites, but has no purpose otherwise IMHO. If this is how people behave, it means that most people will need to reimplement their own custom selectors like getSelector: (colorScheme) => colorScheme ? `.theme-${colorScheme}` : ':root',. So, wouldn't it be better to match Tailwind CSS API? https://tailwindcss.com/docs/dark-mode#toggling-dark-mode-manually. I would propose something like this:
Steps to reproduce
I'm confused by this
getSelector
API:getColorSchemeSelector
so maybe the name should be merged. Now, I imagine we shouldn't confuse it with the helper developer would use to write conditional logic, e.g.theme.applyStyles('dark', {})
.pigment-css/packages/pigment-css-react/src/utils/extendTheme.ts
Lines 20 to 35 in e672e4b
pigment-css/packages/pigment-css-react/src/utils/extendTheme.ts
Lines 150 to 155 in e672e4b
getSelector: (colorScheme) => colorScheme ? `.theme-${colorScheme}` : ':root',
. So, wouldn't it be better to match Tailwind CSS API? https://tailwindcss.com/docs/dark-mode#toggling-dark-mode-manually. I would propose something like this:Context
As a side note:
pigment-css/packages/pigment-css-react/src/utils/extendTheme.ts
Line 104 in e672e4b
pigment-css/apps/pigment-css-next-app/next.config.js
Line 84 in e672e4b
but the expected type is a string:
pigment-css/packages/pigment-css-react/src/utils/extendTheme.ts
Line 154 in e672e4b
:hover
,:focus-visible
, etc styles.pigment-css/README.md
Line 667 in e672e4b
This makes the case for why we need 1.
Your environment
npx @mui/envinfo
Search keywords: -
The text was updated successfully, but these errors were encountered: