项目作者: YunYouJun

项目描述 :
Markdown Css about violet wandering planet.
高级语言: SCSS
项目地址: git://github.com/YunYouJun/star-markdown-css.git
创建时间: 2018-07-01T08:26:15Z
项目社区:https://github.com/YunYouJun/star-markdown-css

开源协议:MIT License

下载


star-markdown-css

Markdown Css about starry.

Demo
npm
npm
npm bundle size (minified + gzip)
npm bundle size (minified)
jsDelivr hits (npm)

Theme

Planet
Blood

  • Planet(default): violet wandering planet
  • Blood
  • Pure

Install By

Download

CDN

Yarn Or NPM

  1. yarn add star-markdown-css
  2. # or
  3. npm install star-markdown-css

Usage

Import the star-markdown.css file and add a markdown-body class to the container of your rendered Markdown and set a width for it.
GitHub uses 980px width and 45px padding, and 15px padding for mobile.

Html

Just use css with link tag.

  1. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/star-markdown-css/dist/planet/markdown.min.css" />

Example In HTML

In html.

  1. <html>
  2. <meta name="viewport" content="width=device-width, initial-scale=1" />
  3. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/star-markdown-css/dist/planet/markdown.min.css" />
  4. <style>
  5. .markdown-body {
  6. box-sizing: border-box;
  7. min-width: 200px;
  8. max-width: 980px;
  9. margin: 0 auto;
  10. padding: 45px;
  11. }
  12. @media (max-width: 767px) {
  13. .markdown-body {
  14. padding: 15px;
  15. }
  16. }
  17. </style>
  18. <body>
  19. <article class="markdown-body">
  20. <h1>Unicorns</h1>
  21. <p>All the things</p>
  22. </article>
  23. </body>
  24. </html>

Vue

Just import it where you need it.

  1. import 'star-markdown-css'

Example In Vue

In a vue component.

You can try vite-plugin-vue-markdown.

  1. <template>
  2. <div class="markdown-body">
  3. <!-- You Markdown -->
  4. </div>
  5. </template>
  6. <script>
  7. import 'star-markdown-css'
  8. // ...
  9. </script>
  10. <style>
  11. .markdown-body {
  12. box-sizing: border-box;
  13. min-width: 200px;
  14. max-width: 980px;
  15. margin: 0 auto;
  16. padding: 0px 20px;
  17. }
  18. @media (max-width: 767px) {
  19. .markdown-body {
  20. padding: 15px;
  21. }
  22. }
  23. </style>

Or in main.ts:

  1. import 'star-markdown-css'
  2. // ...

Dev

Start

  1. # Install Dependencies
  2. pnpm
  3. # start dev
  4. pnpm dev
  5. # You can see in http://localhost:3333

Build

  1. yarn build

Intend

  • Add KLK Style (Pure & Blood)
  • Use Vue Demo

Thanks

Sponsors