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

精读《css-in-js 杀鸡用牛刀》 #38

Closed
ascoders opened this issue Oct 9, 2017 · 3 comments
Closed

精读《css-in-js 杀鸡用牛刀》 #38

ascoders opened this issue Oct 9, 2017 · 3 comments

Comments

@ascoders
Copy link
Owner

ascoders commented Oct 9, 2017

文章地址:https://codeburst.io/css-in-js-is-like-replacing-a-broken-screwdriver-with-your-favorite-hammer-c9765c9ee43b

文章提到,虽然 css 还有许多不足,但已经在改进中,并且提醒我们关注已经产生的 OOCSS, SMACSS, BEM, ITCSS, 和 ECSS 方案。同时 css-in-js 的模块化思维确实可取,但曲解了 css 本意,被抱怨的全局冲突问题,也是为了控制整站样式与切换主题。

也许 css-in-js 是一条误解 css 本意的道路,那么问题来了,显然 css 在初期(未来应该也是)被设计用来控制全局,那么就越来越复杂的 web 生态而言,是整体控制好呢,还是局部控制好?

@DanielWLam
Copy link

css in js在vue的实现就是scoped吧,react是怎样的?

@ascoders
Copy link
Owner Author

@DanielWLam css in js 通用方案热门可以看 css-modules,基于 react 的定制方案有 原生-内连样式 社区-styled-components,底层一点的有 cssx

更多可以参考:awesome-css-in-js

@AlwaysHacking
Copy link

AlwaysHacking commented Oct 10, 2017

css in js最早是react社区提出来的,vue的作者比较反对css in js这种行为,当然也要认可社区的活跃和创造性。
这篇文章说的是同样的主题,提到从书写代码便利性的角度反对css in js。

@ascoders ascoders mentioned this issue Oct 16, 2017
65 tasks
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

3 participants