【问题标题】:How to apply list-disc to ul rendered by Markdownit?如何将 list-disc 应用于 Markdownit 呈现的 ul?
【发布时间】:2021-02-13 12:41:24
【问题描述】:

我目前正在将 Nuxtjs 与 Tailwind 和 @nuxtjs/markdownit 一起使用。

我是这样注入 Markdown 的:

<div v-html="$md.render(myMarkdownString)" class="styled"></div>

我在上述myMarkdownString 中有一个列表,并且已经应用​​了一些可以正常工作的样式。像这样:

.styled >>> strong,
.style >>> a {
  @apply text-black font-bold;
}

.style >>> ul {
  @apply bg-gray-200;
}

但是当我使用@apply list-disc 时,什么都没有发生。

【问题讨论】:

    标签: css tailwind-css nuxtjs


    【解决方案1】:

    我遇到了和你一样的问题:list-disc 似乎对标记没有任何作用。

    似乎解决此问题的方法是添加 list-inside 规则:

    ul {
      @apply list-inside list-disc;
    }
    

    【讨论】:

      猜你喜欢
      • 2021-12-25
      • 1970-01-01
      • 1970-01-01
      • 2015-11-21
      • 1970-01-01
      • 1970-01-01
      • 2011-11-17
      • 2010-11-17
      • 1970-01-01
      相关资源
      最近更新 更多