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

兼容暗黑模式,组件编写规范 #26

Open
fengxinhhh opened this issue Jul 21, 2022 · 0 comments
Open

兼容暗黑模式,组件编写规范 #26

fengxinhhh opened this issue Jul 21, 2022 · 0 comments

Comments

@fengxinhhh
Copy link
Owner

如果有想法想feat component的话,在兼容暗黑模式,有几个规范需要告诉你:

  1. Concis目前提供暗黑主题,在文档显示需要兼容,开发组件需要在样式文件中提供两套类名,如concis-button(light) / concis-dark-button(dark);
  2. 在组件代码中需根据GlobalConfig context中darkTheme来判断用户项目是否开启深色模式,开启即使用concis-dark-component类。
    image
    参考之前组件的模板就好,写的很清楚,集成所有类名,给组件原本类名加一个判断就可以,后续推出其他主题可能会改变写法,先暂时这么做。
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

1 participant