diff --git a/.changeset/khaki-ties-sip.md b/.changeset/khaki-ties-sip.md new file mode 100644 index 0000000..5d30eed --- /dev/null +++ b/.changeset/khaki-ties-sip.md @@ -0,0 +1,5 @@ +--- +'vite-plugin-tailwind-purgecss': patch +--- + +fix: Added `data-theme` to the safelist diff --git a/src/index.ts b/src/index.ts index 85c1eaf..28835da 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,7 +23,6 @@ export function purgeCss(purgeOptions?: PurgeOptions): Plugin { 'html', 'body', /aria-current/, - /svelte-/, // fix for pseudo-class functions that begin with `:` getting purged (e.g. `:is`) // see: https://github.com/FullHuman/purgecss/issues/978 /^\:[-a-z]+$/, @@ -102,7 +101,7 @@ export function purgeCss(purgeOptions?: PurgeOptions): Plugin { safelist: { ...purgeOptions?.safelist, standard, - greedy: [/svelte-/, ...(purgeOptions?.safelist?.greedy ?? [])], + greedy: [/svelte-/, /data-theme/, ...(purgeOptions?.safelist?.greedy ?? [])], }, });