Skip to content

Commit

Permalink
Make docs a bit easier on the eyes (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
damianstasik authored Sep 18, 2023
1 parent 7af2b27 commit e2ab8d6
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion src/theme/DocItem/Content.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,56 @@
import React from "react";
import clsx from "clsx";
import MDXContent from "@theme/MDXContent";

const classNames = [
"prose",
"lg:prose-lg",
"text-gray-900",
"dark:text-gray-100",
"dark:prose-invert",
"marker:text-gray-600",
"dark:marker:text-gray-400",
"max-w-none",

// <hr>
"prose-hr:my-6",
"prose-hr:border-gray-200",
"prose-hr:border-solid",
"dark:prose-hr:border-gray-800",

// <pre>
"prose-pre:bg-blue-900",

// <code>
"prose-code:px-1.5",
"prose-code:text-current",
"dark:prose-code:text-current",
"dark:prose-code:border-gray-600",
"prose-code:before:content-none",
"prose-code:after:content-none",

// <a>
"prose-a:text-current",
"hover:prose-a:text-black/50",
"dark:prose-a:text-current",
"dark:hover:prose-a:text-white/50",

// <strong>
"prose-strong:text-current",
"dark:prose-strong:text-current",

// <h1>, <h2>, <h3>
"prose-h1:text-4xl",
"prose-h2:text-3xl",
"prose-h3:text-2xl",

"prose-th:px-3",
"prose-td:px-3",
];

export default function DocItemContent({ children }) {
return (
<div className="prose max-w-none prose-hr:my-6 dark:prose-hr:border-gray-800 prose-hr:border-gray-200 prose-hr:border-solid prose-pre:bg-blue-900 text-gray-600 dark:text-gray-500 lg:prose-lg prose-h1:text-4xl prose-h2:text-3xl dark:prose-invert prose-code:px-1.5 prose-code:before:content-none prose-code:after:content-none">
<div className={clsx(classNames)}>
<MDXContent>{children}</MDXContent>
</div>
);
Expand Down

0 comments on commit e2ab8d6

Please sign in to comment.