reactjs 需要在一个React组件的HTML标记的默认CSS

2exbekwf  于 5个月前  发布在  React
关注(0)|答案(1)|浏览(75)

我在我的应用程序中使用tailwindcss。默认情况下,tailwindcss将覆盖h1,p,ul,ol和all等标签的css。我只想要一个标签需要有自己的默认样式的组件。我尝试使用preflight:false,但它会影响所有组件,但我只想要一个组件内的标签的默认样式

/** @type {import('tailwindcss').Config} */
export default {
 content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
 theme: {
 extend: {
  colors: {
    "alice-blue": "#F0F2FF",
    "dark-jungle": "#1E2022",
    "dark-orange": "#FE8E01",
    "pantone-green": "#00AF36",
    "chinese-white": "#D6F2DE",
    "azureish-white": "#DDE8F5",
    "hover-blue": "#0921FF",
    "active-blue": "#2737CE",
    "focus-blue": "#CFD1FF",
    "hover-light-blue": "#E0EEFF",
    "active-light-blue": "#D0E3F9",
    "anti-flash-white": "#edeff7",
    "roman-silver": "#818B94",
    "shuttle-gray": "#5D666E",
    "green-white": "#E8EAEE",
    "tropical-blue": "#CCD9E9",
    "cyan-blue": "#8B949D",
    "palatinate-blue": {
      50: "#ebf4ff",
      100: "#dbe9ff",
      200: "#bed7ff",
      300: "#97bbff",
      400: "#6e92ff",
      500: "#4c6bff",
      600: "#2e42ff",
      700: "#202fe2",
      800: "#1d2bb6",
      900: "#202d8f",
      950: "#131953",
    },
  },
 },
},
 plugins: [],
};

字符串

xmjla07d

xmjla07d1#

试试

<div class="prose"> 
      <!-- component / tag with default style here -->
</div>

字符串

相关问题