fix issue 1138 (#1139)

main
Michael Fix 4 years ago committed by GitHub
parent 1d89aab0da
commit 75c925db84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,7 +7,7 @@ import Typography from './style/Typography'
const CODEMIRROR_VERSION = '5.58.2'
const HIGHLIGHTS_ONLY = ['shades-of-purple', 'vscode', 'a11y-dark']
export const HIGHLIGHTS_ONLY = ['shades-of-purple', 'vscode', 'a11y-dark']
const LOCAL_STYLESHEETS = ['one-light', 'one-dark', 'verminal', 'night-owl', 'nord', 'synthwave-84']
const CDN_STYLESHEETS = THEMES.filter(
t => LOCAL_STYLESHEETS.indexOf(t.id) < 0 && HIGHLIGHTS_ONLY.indexOf(t.id) < 0

@ -5,7 +5,7 @@ import { withRouter } from 'next/router'
// Ours
import ApiContext from '../../components/ApiContext'
import { StylesheetLink, CodeMirrorLink, MetaTags } from '../../components/Meta'
import { StylesheetLink, CodeMirrorLink, MetaTags, HIGHLIGHTS_ONLY } from '../../components/Meta'
import Font from '../../components/style/Font'
import Carbon from '../../components/Carbon'
import GlobalHighlights from '../../components/Themes/GlobalHighlights'
@ -22,7 +22,7 @@ const Page = props => (
<CodeMirrorLink />
<Font />
{props.children}
{props.theme === 'a11y-dark' && (
{HIGHLIGHTS_ONLY.includes(props.theme) && (
<GlobalHighlights highlights={THEMES_HASH[props.theme].highlights} />
)}
<style jsx global>

Loading…
Cancel
Save