Skip to content

Commit

Permalink
fix(site): bundle css and remove css minification
Browse files Browse the repository at this point in the history
html-minifier uses cleancss. After testing a bit, it seems CleanCSS will the ENTIRE icon-table CSS styles... which, btw, is just a simple:
```css
.icon-table {
    td {
      text-align: center;
      vertical-align: middle;
    }
  }
```
Why? IDK! It's utterly preposterous. What did this innocent CSS ever do to deserve this?!?
  • Loading branch information
TrebledJ committed Jun 10, 2024
1 parent 0fcd890 commit a517361
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 28 deletions.
1 change: 1 addition & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<link rel="stylesheet" href="{{asset}}" media="print"/>
{% endfor %}
{% endif %}
<style>{% getBundle "css" %}</style>

{% include "utilities/async-css.html" %}
{% include "utilities/theme-switch.html" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,16 @@ It's a lot of indirection, and this is one reason why SVGs are preferred; but he

To complicate matters, FA fonts have different **variants**, and they modularise this by using the same codepoint, but separate font files. Not all fonts do this though. Devicon packs all their styles into a single font file. Here are some examples of FA styles.

{% table "td {text-align: center; vertical-align: middle; }" %}
{% css %}
.icon-table {
td {
text-align: center;
vertical-align: middle;
}
}
{% endcss %}

{% table "icon-table" %}

| | Solid | Regular | Brands |
|-------------------------|----------------------------------|----------------------------------|-------------------------------|
Expand Down
2 changes: 1 addition & 1 deletion eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ module.exports = function (eleventyConfig) {
const minified = htmlmin.minify(content, {
removeComments: true,
includeAutoGeneratedTags: false,
minifyCSS: true,
minifyCSS: false,
minifyJS: true,
collapseWhitespace: true,
collapseBooleanAttributes: true, // e.g. no <script defer="defer">.
Expand Down
2 changes: 1 addition & 1 deletion eleventy/shortcodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = function (eleventyConfig) {
'<div class="details-collapse-bottom"><sub><a class="details-collapse-button">(collapse)</a></sub></div></div></details>'
));

eleventyConfig.addShortcode('table', style => `<div class="table-container" style="${style ?? ''}">`);
eleventyConfig.addShortcode('table', clss => `<div class="table-container ${clss ?? ''}">`);

// Paired shortcode workaround: see Note [endalert Workaround].
eleventyConfig.addShortcode('endtable', () => '</div>');
Expand Down
41 changes: 16 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a517361

Please sign in to comment.