next.js/test/e2e/postcss-config-ts/postcssrc/plugin.ts
plugin.ts20 lines422 B
// Custom PostCSS plugin that transforms color: red to color: green
// This allows us to verify that the PostCSS config is actually being applied

const plugin = () => {
  return {
    postcssPlugin: 'color-transform',
    Declaration: {
      color(decl: { value: string }) {
        if (decl.value === 'red') {
          decl.value = 'green'
        }
      },
    },
  }
}

plugin.postcss = true

export default plugin
Quest for Codev2.0.0
/
SIGN IN