Skip to content

Conversation

@miswanting
Copy link

@miswanting miswanting commented Oct 24, 2023

https://tdesign.tencent.com/vue-next/dark-mode-en

Some UI libraries (such as TDesign) use a theme-mode attribute on HTML tags to control dark mode, which cannot be implemented by the existing dataValue option, so a new option named attrName is added, with control logic similar to that of 'dataValue'.

Also fixed missing 'dataValue' in the sample code.

@nuxt-studio
Copy link

nuxt-studio bot commented Oct 24, 2023

Live Preview ready!

Name Edit Preview Latest Commit
Color Mode Edit on Studio ↗︎ View Live Preview de45ce0

@netlify
Copy link

netlify bot commented Oct 24, 2023

Deploy Preview for nuxt-color-mode ready!

Name Link
🔨 Latest commit de45ce0
🔍 Latest deploy log https://app.netlify.com/sites/nuxt-color-mode/deploys/653791f4dc40dd0008fb174e
😎 Deploy Preview https://deploy-preview-215--nuxt-color-mode.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 configuration.

Copy link
Collaborator

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

Would it be possible to merge with dataValue so we don't duplicate the runtime code? Perhaps we leave just the attrName code, and normalise attrName -> data-${dataValue}?

@miswanting
Copy link
Author

You mean: keep these two options, but merge them into one implement code, in order to reduce the code duplicate?

If so, I`ll try.

And here's another thing I need your recommend: Is it okay to name such option as attrName? Or any name better?

@atinux
Copy link
Contributor

atinux commented Nov 21, 2023

@miswanting I think it would be nice to discuss with the TDesign team as the theme-mode is not a valid HTML attribute, I would recommend data-theme-mode in that case

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.

3 participants