- 授权协议: MIT
- 开发语言: JavaScript
- 操作系统: 跨平台
- 软件首页: https://github.com/FullHuman/purgecss
- 软件文档: https://github.com/FullHuman/purgecss/blob/master/README.md
- 官方下载: https://github.com/FullHuman/purgecss
软件介绍
当你建立一个网站的时候,你可能会大量使用像Bootstrap,Materializecss,Foundation这样的框架,但是你只会使用其中的一小部分,而且这部分还包括了大量的多余的CSS样式。Purgecss起作用了,Purgecss会分析你的内容和你的css文件。然后将文件中使用的选择器与内容文件中的选择器相匹配。再从CSS中删除未使用的选择器,是的css文件变得更小。
入门:
安装
npm i --save-dev purgecss
使用
import Purgecss from 'purgecss'
const purgeCss = new Purgecss({
content: ['**/*.html'],
css: ['**/*.css']
})
const result = purgecss.purge()使用自定义提取器:
import Purgecss from 'purgecss'
import purgeHtml from 'purge-from-html'
const purgeCss = new Purgecss({
content: ['**/*.html'],
css: ['**/*.css'],
extractors: [
{
extractor: purgeHtml,
extensions: ['html']
}
]
})
const result = purgecss.purge()
The Smashing Book
Jacob Gube、Dmitry Fadeev、Chris Spooner、Darius A Monsef IV、Alessandro Cattaneo、Steven Snell、David Leggett、Andrew Maier、Kayla Knight、Yves Peters、René Schmidt、Smashing Magazine editorial team、Vitaly Friedman、Sven Lennartz / 2009 / $ 29.90 / € 23.90
The Smashing Book is a printed book about best practices in modern Web design. The book shares technical tips and best practices on coding, usability and optimization and explores how to create succes......一起来看看 《The Smashing Book》 这本书的介绍吧!
