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
feat(preset-mini): customizing dark mode selector #1250
Conversation
✅ Deploy Preview for unocss ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
packages/preset-mini/src/index.ts
Outdated
export interface PresetMiniOptions extends PresetOptions { | ||
/** | ||
* @default 'class' | ||
*/ | ||
dark?: 'class' | 'media' | ||
dark?: 'class' | 'media' | ['class', DarkSelector] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dark?: 'class' | 'media' | ['class', DarkSelector] | |
dark?: 'class' | 'media' | DarkModeSelectors |
packages/preset-mini/src/index.ts
Outdated
@@ -11,7 +11,7 @@ export { parseColor } from './utils' | |||
|
|||
export type { ThemeAnimation, Theme } | |||
|
|||
interface DarkSelector { | |||
type DarkModeSelectors = ['class', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a simple object is enough, the array feels redundant to me (plus they are not always class
anyway)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as I thought, not sure why tailwindicss
needs to set a class
close: #1248