import Head from 'next/head' import { THEMES } from '../lib/constants' import Reset from './style/Reset' import Font from './style/Font' import Typography from './style/Typography' const LOCAL_STYLESHEETS = ['one-dark', 'verminal', 'night-owl', 'nord'] const CDN_STYLESHEETS = THEMES.filter(t => LOCAL_STYLESHEETS.indexOf(t.id) < 0) 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` } return ( ) } export const CodeMirrorLink = () => ( ) export const MetaTags = () => ( Carbon ) /* * Before supporting verify that it is widely supported in FireFox * with out a flag here: https://caniuse.com/#feat=link-rel-preload */ export default function Meta() { const onBrowser = typeof window !== 'undefined' return (
Carbon {LOCAL_STYLESHEETS.map(id => ( ))} {onBrowser ? CDN_STYLESHEETS.map(theme => ( )) : null}
) }