import type { PluginCreator } from "postcss" ; const customPropRegex = /var\(--([A-z][\w-]*)\)/g ; const plugin = ( ) => ( { postcssPlugin : "odyssey-postcss-theme" , OnceExit ( root ) { root . walkDecls ( ( decl ) => { decl . value = decl . value . replace ( customPropRegex , ( _ , capture ) => `\$\{theme.${ capture }\}` ) ; } ) ; } } ) ; plugin . postcss = true ; export { plugin as default } ;