immutable-styles 基本试用

此文档来自官方文档,从官方demo 学起比较快

安装

官方推荐的是通过webpack 的构建方式,通过babel loader

clone 代码

git clone https://github.com/callum-hart/immutable-styles-tutorial.git

安装依赖

yarn

构建&&运行

  • dev 模式
yarn start

生成的css 文件,从文件可以看出基于attr 的模式

  • 构建
yarn build

说明

immutable-styles 提出的解决方法还是不错,同时作者的http://www.callumhart.com/blog/css-overrides-friend-or-foe 这篇文章写的也不错
可以了解下作者的触发点,以及解决问题的思路,同时可以参考https://callum-hart.gitbook.io/immutable-styles/beginnertutorial 这篇文章
具体的了解使用

参考

https://callum-hart.gitbook.io/immutable-styles/beginnertutorial
http://www.callumhart.com/blog/css-overrides-friend-or-foe
https://github.com/callum-hart/immutable-styles-tutorial.git

posted on 2019-02-14 10:48  荣锋亮  阅读(252)  评论(0编辑  收藏  举报

导航