From 6de49b9f1a7e97d74568fd4f272f36b13e4bb571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Bl=C3=A4ttermann?= Date: Mon, 14 Nov 2022 01:18:47 +0100 Subject: [PATCH] Fix broken CSS classes --- website/src/components/code.js | 46 +++++++++++----------- website/src/components/embed.js | 4 +- website/src/components/github.js | 6 ++- website/src/components/landing.js | 49 ++++++++++++----------- website/src/components/link.js | 4 +- website/src/components/list.js | 2 +- website/src/components/main.js | 4 +- website/src/components/navigation.js | 4 +- website/src/components/quickstart.js | 58 +++++++++++++++------------- website/src/components/sidebar.js | 23 +++++------ website/src/components/table.js | 2 +- website/src/components/title.js | 2 +- website/src/components/typography.js | 4 +- 13 files changed, 111 insertions(+), 97 deletions(-) diff --git a/website/src/components/code.js b/website/src/components/code.js index 28e3cb5d4..199de6bbd 100644 --- a/website/src/components/code.js +++ b/website/src/components/code.js @@ -26,12 +26,12 @@ const CodeBlock = (props) => ( export default CodeBlock export const Pre = (props) => { - return
{props.children}
+ return
{props.children}
} export const InlineCode = ({ wrap = false, className, children, ...props }) => { - const codeClassNames = classNames(classes.inlineCode, className, { - [classes.wrap]: wrap || (isString(children) && children.length >= WRAP_THRESHOLD), + const codeClassNames = classNames(classes['inline-code'], className, { + [classes['wrap']]: wrap || (isString(children) && children.length >= WRAP_THRESHOLD), }) return ( @@ -78,10 +78,10 @@ export const TypeAnnotation = ({ lang = 'python', link = true, children }) => { const annotClassNames = classNames( 'type-annotation', `language-${lang}`, - classes.inlineCode, - classes.typeAnnotation, + classes['inline-code'], + classes['type-annotation'], { - [classes.wrap]: code.length >= WRAP_THRESHOLD, + [classes['wrap']]: code.length >= WRAP_THRESHOLD, } ) return ( @@ -89,7 +89,7 @@ export const TypeAnnotation = ({ lang = 'python', link = true, children }) => { {elements.map((el, i) => ( {linkType(el, !!link)} ))} - {meta && {meta}} + {meta && {meta}} ) } @@ -134,7 +134,7 @@ function convertLine(line, i) { }) return ( - + python -m {' '} spacy{' '} @@ -142,9 +142,9 @@ function convertLine(line, i) { const isCmd = j === 0 const url = isCmd ? `/api/cli#${item.replace(' ', '-')}` : null const isAbstract = isString(item) && /^\[(.+)\]$/.test(item) - const itemClassNames = classNames(classes.cliArg, { - [classes.cliArgHighlight]: isCmd, - [classes.cliArgEmphasis]: isAbstract, + const itemClassNames = classNames(classes['cli-arg'], { + [classes['cli-arg-highlight']]: isCmd, + [classes['cli-arg-emphasis']]: isAbstract, }) const text = isAbstract ? item.slice(1, -1) : item return ( @@ -238,11 +238,11 @@ export class Code extends React.Component { render() { const { lang, title, executable, github, prompt, wrap, highlight, className, children } = this.props - const codeClassNames = classNames(classes.code, className, `language-${lang}`, { - [classes.wrap]: !!highlight || !!wrap || lang === 'cli', - [classes.cli]: lang === 'cli', + const codeClassNames = classNames(classes['code'], className, `language-${lang}`, { + [classes['wrap']]: !!highlight || !!wrap || lang === 'cli', + [classes['cli']]: lang === 'cli', }) - const ghClassNames = classNames(codeClassNames, classes.maxHeight) + const ghClassNames = classNames(codeClassNames, classes['max-height']) const { Juniper } = this.state if (github) { @@ -264,7 +264,7 @@ export class Code extends React.Component { const html = formatCode(rawHtml, lang, prompt) return ( <> - {title &&

{title}

} + {title &&

{title}

} {html} ) @@ -275,10 +275,10 @@ const JuniperWrapper = ({ Juniper, title, lang, children }) => { const { binderUrl, binderVersion } = siteMetadata const juniperTitle = title || 'Editable Code' return ( -
-

+
+

{juniperTitle} - + spaCy v{binderVersion} · Python 3 · via{' '} Binder @@ -291,10 +291,10 @@ const JuniperWrapper = ({ Juniper, title, lang, children }) => { branch={binderBranch} lang={lang} classNames={{ - cell: classes.juniperCell, - input: classes.juniperInput, - button: classes.juniperButton, - output: classes.juniperOutput, + cell: classes['juniper-cell'], + input: classes['juniper-input'], + button: classes['juniper-button'], + output: classes['juniper-output'], }} > {children} diff --git a/website/src/components/embed.js b/website/src/components/embed.js index 9f959bc99..14d333e97 100644 --- a/website/src/components/embed.js +++ b/website/src/components/embed.js @@ -89,7 +89,7 @@ const Image = ({ src, alt, title, ...props }) => { // This is only needed for image types that are NOT handled by // gatsby-remark-images, i.e. mostly SVGs. The plugin adds formatting // and support for captions, so this normalises that behaviour. - const linkClassNames = classNames('gatsby-resp-image-link', classes.imageLink) + const linkClassNames = classNames('gatsby-resp-image-link', classes['image-link']) const markdownComponents = { code: InlineCode, p: Fragment, a: Link } return (
@@ -111,7 +111,7 @@ const GoogleSheet = ({ id, link, height, button = 'View full table' }) => {