Break words in the inlineCode component
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
9f547ab299
commit
96fa48f356
|
@ -0,0 +1,6 @@
|
||||||
|
.code {
|
||||||
|
padding: 0 calc(4rem / 16);
|
||||||
|
background: var(--code-background);
|
||||||
|
border-radius: calc(5rem / 16);
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
import React, { HTMLAttributes } from "react";
|
||||||
|
|
||||||
|
import styles from "./Code.module.css";
|
||||||
|
|
||||||
|
export function Code(props: HTMLAttributes<HTMLElement>) {
|
||||||
|
const classes = [styles.code, props.className ?? ""];
|
||||||
|
|
||||||
|
return <code {...props} className={classes.join(" ")} />;
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
.pre {
|
.pre {
|
||||||
padding: calc(10rem / 16);
|
padding: calc(10rem / 16);
|
||||||
background: var(--input-background);
|
background: var(--code-background);
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
border-radius: calc(5rem / 16);
|
border-radius: calc(5rem / 16);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { AppProps as DefaultAppProps } from "next/app";
|
||||||
import React, { ComponentType, ReactNode } from "react";
|
import React, { ComponentType, ReactNode } from "react";
|
||||||
|
|
||||||
import { Button } from "@/components/Button";
|
import { Button } from "@/components/Button";
|
||||||
|
import { Code } from "@/components/Code";
|
||||||
import { DefaultLayout } from "@/components/DefaultLayout";
|
import { DefaultLayout } from "@/components/DefaultLayout";
|
||||||
import { Footer } from "@/components/Footer";
|
import { Footer } from "@/components/Footer";
|
||||||
import { HorizontalLine } from "@/components/HorizontalLine";
|
import { HorizontalLine } from "@/components/HorizontalLine";
|
||||||
|
@ -23,7 +24,13 @@ export default function App({ Component, pageProps }: AppProps): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<ThemeProvider>
|
<ThemeProvider>
|
||||||
<MDXProvider
|
<MDXProvider
|
||||||
components={{ a: Link, hr: HorizontalLine, button: Button, pre: Pre }}
|
components={{
|
||||||
|
a: Link,
|
||||||
|
hr: HorizontalLine,
|
||||||
|
button: Button,
|
||||||
|
pre: Pre,
|
||||||
|
inlineCode: Code,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div className={styles.appContainer}>
|
<div className={styles.appContainer}>
|
||||||
<Navbar />
|
<Navbar />
|
||||||
|
|
Loading…
Reference in New Issue