Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make docs a bit easier on the eyes #108

Merged
merged 5 commits into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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