diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 99cf717f..7b56619a 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -176,8 +176,14 @@ const config: Config = { // copyright: `Copyright © ${new Date().getFullYear()} OpenWebUI`, }, prism: { - theme: { plain: { color: "#333", backgroundColor: "#f3f3f3" }, styles: [] }, - darkTheme: { plain: { color: "#ccc", backgroundColor: "#1a1a1a" }, styles: [] }, + theme: { + plain: { color: "#333", backgroundColor: "#f3f3f3" }, + styles: [], + }, + darkTheme: { + plain: { color: "#ccc", backgroundColor: "#1a1a1a" }, + styles: [], + }, }, } satisfies Preset.ThemeConfig, plugins: [require.resolve("docusaurus-lunr-search")], diff --git a/src/css/custom.css b/src/css/custom.css index 080050a2..721da45d 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -241,7 +241,9 @@ code { border-radius: var(--ifm-global-radius); cursor: pointer; opacity: 0; - transition: opacity 200ms ease-in-out, background-color 200ms ease-in-out; + transition: + opacity 200ms ease-in-out, + background-color 200ms ease-in-out; } [data-theme="light"] .shiki-copy-button { diff --git a/src/theme/CodeBlock/index.tsx b/src/theme/CodeBlock/index.tsx index 333270f2..d38df631 100644 --- a/src/theme/CodeBlock/index.tsx +++ b/src/theme/CodeBlock/index.tsx @@ -5,7 +5,12 @@ * String children → stock StringContent (Prism path, full Docusaurus UI). * Element children (Shiki) → lightweight wrapper with a standalone copy button. */ -import React, { isValidElement, useState, useCallback, type ReactNode } from "react"; +import React, { + isValidElement, + useState, + useCallback, + type ReactNode, +} from "react"; import type { Props } from "@theme/CodeBlock"; import useIsBrowser from "@docusaurus/useIsBrowser"; import StringContent from "@theme/CodeBlock/Content/String"; @@ -42,11 +47,25 @@ function CopyButton({ code }: { code: string }) { onClick={handleCopy} > {copied ? ( - + ) : ( - +