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

feat(preset-mini): customizing dark mode selector #1250

Merged
merged 7 commits into from Jul 13, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/preset-mini/src/index.ts
Expand Up @@ -11,7 +11,7 @@ export { parseColor } from './utils'

export type { ThemeAnimation, Theme }

interface DarkSelector {
type DarkModeSelectors = ['class', {
Copy link
Member

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)

Copy link
Member Author

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

/**
* @default '.light'
*/
Expand All @@ -21,13 +21,13 @@ interface DarkSelector {
* @default '.dark'
*/
dark?: string
}
}]

export interface PresetMiniOptions extends PresetOptions {
/**
* @default 'class'
*/
dark?: 'class' | 'media' | ['class', DarkSelector]
dark?: 'class' | 'media' | DarkModeSelectors
/**
* @default false
*/
Expand Down