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] 第47天 你是怎样抽离样式模块的? #178

Open
haizhilin2013 opened this issue Jun 1, 2019 · 5 comments
Open

[css] 第47天 你是怎样抽离样式模块的? #178

haizhilin2013 opened this issue Jun 1, 2019 · 5 comments
Labels
css css

Comments

@haizhilin2013
Copy link
Collaborator

第47天 你是怎样抽离样式模块的?

@haizhilin2013 haizhilin2013 added the css css label Jun 1, 2019
@xiangshuo1992
Copy link
Contributor

样式模块?
通过组件化思想,用BEM方式命名。

@cleverboy32
Copy link

说的是 webpack + extract-text-webpack-plugin插件吧? 把样式文件单独打包出来。
webpack4 升级了插件为 mini-css-extract-plugin

@smallWhitevv
Copy link

把常用的css样式单独做成css文件……通用的和业务相关的分离出来,通用的做成样式模块儿共享,业务相关的,放进业务相关的库里面做成对应功能的模块儿。
原文链接:markyun/markyun#80

@FurryWolfX
Copy link

在使用Vue时,CSS本来就是在组件内的,应该已经算模块化了吧?如果是公用的可以抽离到外面。
在用React时,一般我会使用styled-component方案来组织CSS,使用这种方案时,CSS也可以看作是一个React组件。

@blueRoach
Copy link

vue组件的样式加上scoped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css css
Projects
None yet
Development

No branches or pull requests

6 participants