File size: 505 Bytes
81d8726
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
export const loadMarkdownCSS = (isDark) => {
  const existingLink = document.getElementById('markdown-css')
  if (existingLink) existingLink.remove()
  const link = document.createElement('link')
  link.id = 'markdown-css'
  link.rel = 'stylesheet'
  link.href = isDark
    ? 'https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.8.1/github-markdown-dark.min.css'
    : 'https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.8.1/github-markdown.min.css'
  document.head.appendChild(link)
}