代码之家  ›  专栏  ›  技术社区  ›  aitor

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

  •  0
  • aitor  · 技术社区  · 4 年前

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

    <blockquote>
        :after
        <p>Lorem ipsum.</p>
        :before
    </blockquote>
    

    我想自定义样式,只删除右引号以匹配此模式:

    enter image description here

    是否可以从tailwind.config.js中自定义它,或者我应该用CSS和 !important ?

    0 回复  |  直到 4 年前
        1
  •  1
  •   qetz    4 年前

    如本期所述: 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' },
              },
            },
          },
        },
      },
      //...
    }
    

    并添加类 prose-quoteless 之后添加到您的散文元素以删除所有引号。