sivan / heti

赫蹏(hètí)是专为中文内容展示设计的排版样式增强。它基于通行的中文排版规范而来,可以为网站的读者带来更好的文章阅读体验。
https://sivan.github.io/heti/
MIT License
5.92k stars 251 forks source link

建议参考tailwindcss-typography,做成插件一键导入项目 #118

Open 18601673727 opened 1 month ago

18601673727 commented 1 month ago

https://github.com/tailwindlabs/tailwindcss-typography

方便灵活的配置

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    "./pages/**/*.{js,ts,jsx,tsx,mdx}",
    "./components/**/*.{js,ts,jsx,tsx,mdx}",
    "./app/**/*.{js,ts,jsx,tsx,mdx}",
  ],
  theme: {
    extend: {
      typography: {
        // 配置@tailwindcss/typography
        DEFAULT: {
          css: {
            pre: null, // 停用该样式
            code: null, // 停用该样式
          },
        },
      },
    },
  },
  darkMode: "class",
  plugins: [
    require("@tailwindcss/typography"),
  ],
}

简单的@apply

.my-component {
  @apply prose dark:prose-invert prose-stone prose-a:text-primary max-w-none;
}