2024-11-13 00:59:12 +01:00
|
|
|
import path from "node:path";
|
2020-08-01 03:43:15 +02:00
|
|
|
|
2024-11-13 00:59:12 +01:00
|
|
|
import postcssExtendRule from "postcss-extend-rule";
|
|
|
|
import postcssImport from "postcss-import";
|
|
|
|
import postcssPrefixWrap from "postcss-prefixwrap";
|
|
|
|
import postcssPresetEnv from "postcss-preset-env";
|
|
|
|
import postcssSimpleVars from "postcss-simple-vars";
|
2021-08-10 11:08:42 +02:00
|
|
|
|
2024-11-13 00:59:12 +01:00
|
|
|
import {media_breakpoints} from "./src/css_variables.js";
|
2020-10-31 08:54:37 +01:00
|
|
|
|
2024-04-26 01:00:10 +02:00
|
|
|
const config = ({file}) => ({
|
2021-08-10 10:59:46 +02:00
|
|
|
plugins: [
|
2021-11-18 10:58:39 +01:00
|
|
|
(file.basename ?? path.basename(file)) === "dark_theme.css" &&
|
2021-08-10 11:08:42 +02:00
|
|
|
// Add postcss-import plugin with postcss-prefixwrap to handle
|
|
|
|
// the flatpickr dark theme. We do this because flatpickr themes
|
|
|
|
// are not scoped. See https://github.com/flatpickr/flatpickr/issues/2168.
|
2024-11-13 00:59:12 +01:00
|
|
|
postcssImport({
|
|
|
|
plugins: [postcssPrefixWrap("%dark-theme")],
|
2021-08-10 11:08:42 +02:00
|
|
|
}),
|
2024-11-13 00:59:12 +01:00
|
|
|
postcssExtendRule,
|
|
|
|
postcssSimpleVars({variables: media_breakpoints}),
|
|
|
|
postcssPresetEnv({
|
2023-03-17 22:15:00 +01:00
|
|
|
features: {
|
|
|
|
"nesting-rules": true,
|
|
|
|
},
|
|
|
|
}),
|
2021-08-10 10:59:46 +02:00
|
|
|
],
|
2021-08-10 11:08:42 +02:00
|
|
|
});
|
2024-11-13 00:59:12 +01:00
|
|
|
export default config;
|