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 now
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 12, 2023
1 parent 006a1ce commit 1eee8e9
Showing 1 changed file with 1 addition and 48 deletions.
49 changes: 1 addition & 48 deletions config/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,5 @@ 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',
]),
],
}),
],
plugins: [ autoprefixer() ]
}

0 comments on commit 1eee8e9

Please sign in to comment.