如何自定义顺风排版块引用

ait*_*tor 3 tailwind-css

Tailwind 排版,为了添加开始和结束引号,请向块引号添加 anafter和伪元素:before

<blockquote>
    :after
    <p>Lorem ipsum.</p>
    :before
</blockquote>
Run Code Online (Sandbox Code Playgroud)

我想自定义样式,仅删除结束引号以匹配此模式:

在此输入图像描述

是否可以从 tailwind.config.js 自定义它,或者我应该使用 CSS 和 覆盖样式!important

Chr*_*ler 7

如本期所述:https://github.com/tailwindlabs/tailwindcss-typography/issues/66#issuecomment-756834635

您可以将以下配置添加到您的tailwind.config.js

module.exports = {
  theme: {
    // ...
    extend: {
      typography: {
        quoteless: {
          css: {
            'blockquote p:first-of-type::before': { content: 'none' },
            'blockquote p:first-of-type::after': { content: 'none' },
          },
        },
      },
    },
  },
  //...
}
Run Code Online (Sandbox Code Playgroud)

然后将该类添加prose-quoteless到您的散文元素中以删除所有引号。