滤镜

工具类

类名属性值
blur-nonefilter: none
blur-${key}filter: blur(${value});
filter-${key}filter: ${value};
backdrop-${key}backdrop-filter: ${value};

使用方法

windi.config.js
export default {
  theme: {
    filter: {
      none: 'none',
      grayscale: 'grayscale(1)',
      invert: 'invert(1)',
      sepia: 'sepia(1)',
    },
    backdropFilter: {
      none: 'none',
      blur: 'blur(20px)',
    },
  },
  variants: {
    filter: ['responsive'],
    backdropFilter: ['responsive'],
  },
  plugins: [
    require('windicss/plugin/filters'),
  ],
}