forked from cotes2020/jekyll-theme-chirpy
-
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.
perf: tree shaking Bootstrap CSS (cotes2020#1736)
- Loading branch information
Showing
11 changed files
with
65 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,6 @@ webfonts: https://fonts.googleapis.com/css2?family=Lato:wght@300;400&family=Sour | |
|
||
# Libraries | ||
|
||
bootstrap: | ||
css: https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css | ||
|
||
toc: | ||
css: https://cdn.jsdelivr.net/npm/[email protected]/dist/tocbot.min.css | ||
js: https://cdn.jsdelivr.net/npm/[email protected]/dist/tocbot.min.js | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,9 @@ | |
{% endunless %} | ||
|
||
<!-- Bootstrap --> | ||
<link rel="stylesheet" href="{{ site.data.origin[type].bootstrap.css | relative_url }}"> | ||
{% unless jekyll.environment == 'production' %} | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"> | ||
{% endunless %} | ||
|
||
<!-- Theme style --> | ||
<link rel="stylesheet" href="{{ '/assets/css/:THEME.css' | replace: ':THEME', site.theme | relative_url }}"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'dist/bootstrap'; | ||
@import 'main'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
--- | ||
--- | ||
|
||
@import 'main'; | ||
@import 'main | ||
{%- if jekyll.environment == 'production' -%} | ||
.bundle | ||
{%- endif -%} | ||
'; | ||
|
||
/* append your custom style below */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const fs = require('fs'); | ||
const DIST_PATH = '_sass/dist'; | ||
|
||
fs.rm(DIST_PATH, { recursive: true, force: true }, (err) => { | ||
if (err) { | ||
throw err; | ||
} | ||
|
||
fs.mkdirSync(DIST_PATH); | ||
}); | ||
|
||
module.exports = { | ||
content: ['_includes/**/*.html', '_layouts/**/*.html', '_javascript/**/*.js'], | ||
css: ['node_modules/bootstrap/dist/css/bootstrap.min.css'], | ||
keyframes: true, | ||
variables: true, | ||
output: `${DIST_PATH}/bootstrap.css`, | ||
// The `safelist` should be changed appropriately for future development | ||
safelist: { | ||
standard: [/^collaps/, /^w-/, 'shadow', 'border', 'kbd'], | ||
greedy: [/^col-/, /tooltip/] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters