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

Conversation

Dunqing
Copy link
Member

@Dunqing Dunqing commented Jul 13, 2022

close: #1248

@Dunqing Dunqing requested a review from antfu as a code owner July 13, 2022 04:50
@netlify
Copy link

netlify bot commented Jul 13, 2022

Deploy Preview for unocss ready!

Name Link
🔨 Latest commit dda2f85
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/62ce7f3b87859e000a8d3db2
😎 Deploy Preview https://deploy-preview-1250--unocss.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

export interface PresetMiniOptions extends PresetOptions {
/**
* @default 'class'
*/
dark?: 'class' | 'media'
dark?: 'class' | 'media' | ['class', DarkSelector]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
dark?: 'class' | 'media' | ['class', DarkSelector]
dark?: 'class' | 'media' | DarkModeSelectors

@@ -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

@antfu antfu merged commit 43a473c into unocss:main Jul 13, 2022
MellowCo added a commit to MellowCo/unocss-preset-weapp that referenced this pull request Jul 17, 2022
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.

[Feature Request] Customizing the class name
2 participants