next.js 如何禁用Tailwind css为某些文件?

p5fdfcr1  于 2023-08-04  发布在  其他
关注(0)|答案(1)|浏览(137)

我想禁用某些文件的顺风,因为顺风基础样式重写来自CMS的样式。我试过关闭飞行前程序,但它破坏了所有现有的系统。有可能吗?
Tailwind版本-2.2.7
我的顺风配置:

const defaultTheme = require('tailwindcss/defaultTheme');
const colors = require('tailwindcss/colors');

module.exports = {
  mode: 'jit',
  purge: ['./src/**/*.{js,tsx}'],
  theme: {
    extend: {
      colors: {
        indigo: colors.indigo,
        green: colors.green,
        yellow: colors.yellow,
        'royal-blue': {
          100: '#F0F1FC',
          200: '#D9DCF9',
        },
        blueGray: {
          50: '#f8fafc',
          100: '#f1f5f9',
          400: '#94a3b8',
        },
      },
      fontFamily: {
        sans: ['Inter var', ...defaultTheme.fontFamily.sans],
      },
      maxWidth: {
        '8xl': '90rem',
      },
    },
  },
  variants: {},
  plugins: [
    function ({ addComponents }) {
      addComponents({
        '.container': {
          '@screen lg': {
            maxWidth: '1024px',
          },
          '@screen xl': {
            maxWidth: '1140px',
          },
        },
      });
    },
  ],
};```

字符串

htzpubme

htzpubme1#

如果你只是想禁用某些CMS内容的preflight,那么你可以尝试将all: revert;属性添加到所需的元素(及其子元素),这将重置大多数样式为原始值。
Read more on MDN

your-element-selector * {
  all: revert;
}

字符串

相关问题