portails/config/postcss.config.js

64 lines
2.1 KiB
JavaScript
Raw Normal View History

2020-12-02 13:49:08 +01:00
const autoprefixer = require('autoprefixer');
const purgecss = require('@fullhuman/postcss-purgecss');
2020-04-15 15:48:16 +02:00
const whitelister = require('purgecss-whitelister');
module.exports = {
2024-04-19 20:53:32 +02:00
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',
'lazyload',
'lazyloaded',
'alert-link',
'container-fw ',
'container-lg',
'container-fluid',
'offcanvas-backdrop',
'figcaption',
'dt',
'dd',
'showing',
'hiding',
'page-item',
'page-link',
...whitelister(['./assets/scss/**/*.scss', './node_modules/@hyas/doks-core/assets/scss/components/_code.scss', './node_modules/@hyas/doks-core/assets/scss/components/_expressive-code.scss', './node_modules/@hyas/doks-core/assets/scss/common/_syntax.scss'])
]
})
]
};