当前位置: 首页 > 工具软件 > Markdown.css > 使用案例 >

使用github-markdown-css包快速生成文章样式

荀学文
2023-12-01

1.安装

yarn add github-markdown-css

2.导入

import 'github-markdown-css/github-markdown.css'

3.给要使用样式的文章添加类名markdown-body

  <div class="article markdown-body" v-else-if="200">

4. .postcssrc.js文件中配置 exclude: 'github-markdown'  不转换github-markdown中字号样式

module.exports = {
  plugins: {
    'postcss-pxtorem': {
      // rootValue: 37.5,
      rootValue({ file }) {
        return file.indexOf('vant') > -1 ? 37.5 : 75
      },
      propList: ['*'],

      exclude: 'github-markdown'  //配置不要转换的样式资源
    }
  }
}

 类似资料: