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

在react中使用,明暗效果不明显 #7

Open
cuilanxin opened this issue May 9, 2022 · 2 comments
Open

在react中使用,明暗效果不明显 #7

cuilanxin opened this issue May 9, 2022 · 2 comments

Comments

@cuilanxin
Copy link

cuilanxin commented May 9, 2022

53421652086247_ pic_hd

import '@wcj/dark-mode';
function App() {
  return (
    <div style={{background: '#fff'}}>
        <dark-mode permanent light="Light" dark="Dark"></dark-mode>
    </div>
  )
}
@cuilanxin
Copy link
Author

cuilanxin commented May 9, 2022

是不是使用方法不对

@jaywcjlove
Copy link
Owner

@cuilanxin 明暗主题需要自己去写

image

  1. 提供主题切换监听事件
  2. <html> 标签上添加标识 data-color-mode="light"
  3. 提供少量默认 css 变量

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

No branches or pull requests

2 participants