forked from alshedivat/al-folio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support to PurgeCSS (alshedivat#1562)
Tackled alshedivat#1329 with [PurgeCSS](https://purgecss.com/). Being talking with @varuniyer about using [jekyll-uncss](https://github.com/episource/jekyll-uncss) to reduce css file sizes by ditching unused classes. This approach have 3 main problems: 1 - have some limitations as pointed [here](alshedivat#1329 (comment)) 2 - last update to [jekyll-uncss](https://github.com/episource/jekyll-uncss) was about 3 years ago, so it might have a few issues 3 - [uncss](https://github.com/uncss/uncss) haven't seem a new release in a while, currently [lacking maintenance](uncss/uncss#459), and using some deprecated libraries as seem here: ``` npm install -g uncss npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see request/request#3142 npm WARN deprecated [email protected]: this library is no longer supported npm WARN deprecated [email protected]: Use your platform's native performance.now() and performance.timeOrigin. npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142 ``` I thought about giving PurgeCSS a go, since it has been more [actively maintaned](https://github.com/FullHuman/purgecss), but [jekyll-purgecss](https://github.com/mhanberg/jekyll-purgecss) haven't. For this, I needed to change to use some local libraries instead of getting them via CDN. The good news is that it is quite effective in reducing css file sizes. Comparing dir sizes with `du -hs _site/assets/css/`: | current | minify | PurgeCSS | PurgeCSS + minify | | ------- | ------ | -------- | ----------------- | | 1,1M | 988K | 456K | 420K | --------- Signed-off-by: George Araujo <[email protected]>
- Loading branch information
1 parent
f896d15
commit 8effb2d
Showing
52 changed files
with
147 additions
and
18 deletions.
There are no files selected for viewing
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Git LFS file not shown
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown