Integrate markdown styles into web components, Markdown CSS styles will not be conflicted.
npm install @wcj/markdown-styleMarkdown Style
===





Integrate markdown styles into web components, Markdown CSS styles will not be conflicted. The minimal amount of CSS to replicate the GitHub Markdown style. Support dark-mode/night mode.
``bash`
npm install --save @wcj/markdown-style
Or load the ES module directly through unpkg
unpkg.com CDN:
`html`
Skypack CDN:
`html`
Use it in your HTML:
`html`
Markdown HTML
Learn about web components here.
Using it in your React:
`jsx
import React from 'react';
import '@wcj/markdown-style';
function Demo() {
return (
Markdown Style
);
}
`
Convert markdown to html and add markdown style to it:
`html`
\jsx
import React from 'react';
import 'markdown-style';
function Demo() {
return (
Markdown Style
);
}
\``
By default, the dark-mode is automatically switched according to the system. If you need to switch manually, just set the data-color-mode="dark" parameter for .
`html`
`js`
document.documentElement.setAttribute('data-color-mode', 'dark')
document.documentElement.setAttribute('data-color-mode', 'light')
Set the theme, do not automatically switch with the system:
`html`
Markdown Style
Disable internal theme switching functionality
`html``
Markdown Style
As always, thanks to our amazing contributors!
Made with github-action-contributors.
Licensed under the MIT License.