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
a81027a4c4
commit
869de52d72
|
@ -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 {
|
||||
padding: calc(10rem / 16);
|
||||
background: var(--input-background);
|
||||
background: var(--code-background);
|
||||
overflow-x: auto;
|
||||
border-radius: calc(5rem / 16);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import { AppProps as DefaultAppProps } from "next/app";
|
|||
import React, { ComponentType, ReactNode } from "react";
|
||||
|
||||
import { Button } from "@/components/Button";
|
||||
import { Code } from "@/components/Code";
|
||||
import { DefaultLayout } from "@/components/DefaultLayout";
|
||||
import { Footer } from "@/components/Footer";
|
||||
import { HorizontalLine } from "@/components/HorizontalLine";
|
||||
|
@ -23,7 +24,13 @@ export default function App({ Component, pageProps }: AppProps): JSX.Element {
|
|||
return (
|
||||
<ThemeProvider>
|
||||
<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}>
|
||||
<Navbar />
|
||||
|
|
Loading…
Reference in New Issue