mirror of
https://github.com/canonical/canonical.com.git
synced 2025-07-20 16:57:03 +00:00

* feat: Migrate maas.io to /maas * Fix linters * Address review comments * fix: Don't perge venbox styles * fix: Address review comments * fix: Remove brokenn link from /resources
54 lines
1.5 KiB
JavaScript
54 lines
1.5 KiB
JavaScript
const purgeCSSPlugin = require("@fullhuman/postcss-purgecss");
|
|
|
|
/** @type {import('postcss-load-config').Config} */
|
|
let config = {
|
|
plugins: [
|
|
require("autoprefixer"),
|
|
purgeCSSPlugin({
|
|
content: [
|
|
"templates/**/*.html",
|
|
"templates/**/*.jinja",
|
|
"static/**/*.js",
|
|
"static/**/*.tsx",
|
|
"webapp/**/*.py",
|
|
"templates/**/*.md",
|
|
"templates/**/*.py",
|
|
"templates/**/*.xml",
|
|
"static/*.js",
|
|
"static/*.jsx",
|
|
"static/*.md",
|
|
"static/*.tsx",
|
|
"static/*.xml",
|
|
"node_modules/flickity/dist/flickity.pkgd.min.js",
|
|
"node_modules/leaflet/dist/leaflet.js",
|
|
"node_modules/venobox/dist/venobox.min.js",
|
|
],
|
|
defaultExtractor: (content) => content.match(/[\w-/:]+(?<!:)/g) || [],
|
|
safelist: {
|
|
standard: [
|
|
/^cookie-policy/,
|
|
/^form/,
|
|
/^p-/, // Preserve form related classes
|
|
/^u-/, // Utility classes
|
|
/^js-/, // JavaScript-related classes
|
|
/^leaflet-/, // Leaflet classes for map
|
|
/^vbox-/, // VenoBox classes
|
|
/^venobox/, // VenoBox classes
|
|
],
|
|
greedy: [
|
|
/^iti/,
|
|
/^mktoForm/, // Marketo forms
|
|
/^cc-/, // Cookie consent related
|
|
/^optanon/, // Cookie consent related
|
|
/^has-/, // State-related classes
|
|
],
|
|
deep: [/form-.+/],
|
|
keyframes: true,
|
|
variables: true,
|
|
},
|
|
}),
|
|
],
|
|
};
|
|
|
|
module.exports = config;
|