remove extra solarized link

main
Mike Fix 6 years ago
parent 0b366d18f7
commit 1451ee2582

@ -1,5 +1,5 @@
import Head from 'next/head'
import { THEMES } from '../lib/constants'
import { THEMES, THEMES_HASH } from '../lib/constants'
import Reset from './style/Reset'
import Font from './style/Font'
import Typography from './style/Typography'
@ -12,10 +12,10 @@ export const StylesheetLink = ({ theme }) => {
let href
if (LOCAL_STYLESHEETS.indexOf(theme) > -1) {
href = `/static/themes/${theme}.css`
} else if (theme.indexOf('solarized') > -1) {
href = '//cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2/theme/solarized.min.css'
} else {
href = `//cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2/theme/${theme}.min.css`
const themeDef = THEMES_HASH[theme]
href = `//cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2/theme/${themeDef &&
(themeDef.link || themeDef.id)}.min.css`
}
return (
@ -78,14 +78,11 @@ export default function Meta() {
<MetaTags />
<StylesheetLink theme="seti" />
<CodeMirrorLink />
<StylesheetLink theme="seti" />
{LOCAL_STYLESHEETS.map(id => (
<StylesheetLink key={id} theme={id} />
))}
{onBrowser
? CDN_STYLESHEETS.map(theme => (
<StylesheetLink key={theme.id} theme={theme.link || theme.id} />
))
? CDN_STYLESHEETS.map(theme => <StylesheetLink key={theme.id} theme={theme.id} />)
: null}
<Reset />
<Font />

@ -90,11 +90,13 @@ export const THEMES = [
},
{
id: 'solarized dark',
name: 'Solarized (Dark)'
name: 'Solarized (Dark)',
link: 'solarized'
},
{
id: 'solarized light',
name: 'Solarized (Light)'
name: 'Solarized (Light)',
link: 'solarized'
},
{
id: 'tomorrow-night-bright',

Loading…
Cancel
Save