Skip to content

Commit

Permalink
css: Allow all tags
Browse files Browse the repository at this point in the history
This is a workaround until we understand how to fix this.
AFAIK, the purgecss component excludes tags from the generated
css so the resulting website was missing some tags. It is not
clear why this happens only when executed on GH actions and not
locally.

Signed-off-by: Anastassios Nanos <[email protected]>
  • Loading branch information
ananos committed Nov 14, 2023
1 parent 006a1ce commit 2caf996
Showing 1 changed file with 5 additions and 54 deletions.
59 changes: 5 additions & 54 deletions config/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,5 @@
const autoprefixer = require('autoprefixer');
const purgecss = require('@fullhuman/postcss-purgecss');
const whitelister = require('purgecss-whitelister');

module.exports = {
plugins: [
autoprefixer(),
purgecss({
content: [ './hugo_stats.json' ],
extractors: [
{
extractor: (content) => {
const els = JSON.parse(content).htmlElements;
return els.tags.concat(els.classes, els.ids);
},
extensions: ['json'],
},
],
dynamicAttributes: [
'aria-expanded',
'data-bs-popper',
'data-bs-target',
'data-bs-theme',
'data-dark-mode',
'data-global-alert',
'data-pane', // tabs.js
'data-popper-placement',
'data-sizes',
'data-toggle-tab', // tabs.js
'id',
'size',
'type',
],
safelist: [
'active',
'btn-clipboard', // clipboards.js
'clipboard', // clipboards.js
'disabled',
'hidden',
'modal-backdrop', // search-modal.js
'selected', // search-modal.js
'show',
'img-fluid',
'blur-up',
'lazyloaded',
...whitelister([
'./assets/scss/**/*.css',
'./assets/scss/**/*.scss',
'./node_modules/katex/dist/katex.css',
]),
],
}),
],
}
const autoprefixer = require('autoprefixer')

module.exports = {
plugins: [autoprefixer()]
}

0 comments on commit 2caf996

Please sign in to comment.