pnpm install tailwindcss postcss-import postcss-nested autoprefixer
export default defineConfig({
// ...
extraPostCSSPlugins: [require("tailwindcss"), require("autoprefixer")],
// ...
});
/* 根目录下global.less引入 */
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
原因是我们使用了tailwindcss ,默认情况会有tailwindcss的默认属性代码块内我们发现 background-color: transparent; 这个是默认属性导致的
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
background-color: transparent;
background-image: none;
}