sindresorhus / github-markdown-css

The minimal amount of CSS to replicate the GitHub Markdown style
https://sindresorhus.com/github-markdown-css
MIT License
7.98k stars 2.1k forks source link

How to use light theme only with React? #107

Open bleschunov opened 1 year ago

bleschunov commented 1 year ago

Now I use it in this way:

import React, { FC } from "react"
import "github-markdown-css"
import ReactMarkdown from "react-markdown"
import remarkGfm from "remark-gfm"

interface MarkdownI {
    children: string
}

const Markdown: FC<MarkdownI> = ({ children }) => {
    return (
        <div className='markdown-body'>
            <ReactMarkdown remarkPlugins={[remarkGfm]}>{children}</ReactMarkdown>
        </div>
    )
}

export default Markdown

It switches between light and dark themes. How to import only light theme?

sindresorhus commented 1 year ago

Maybe import "github-markdown-css/github-markdown-light"

yaeda commented 1 year ago

In my environment, import "github-markdown-css/github-markdown-light" didn't work, but import "github-markdown-css/github-markdown-light.css"; did.