Skip to content

Commit

Permalink
docs: modify docs build config
Browse files Browse the repository at this point in the history
  • Loading branch information
vikiboss committed Aug 16, 2024
1 parent 1786a1b commit edd3ff0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/docs/theme/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@unocss/reset/tailwind.css'

import './style.css'

import Theme from 'rspress/theme'
Expand Down
9 changes: 9 additions & 0 deletions docs/docs/theme/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
@unocss;

.hide-scrollbar {
scrollbar-width: none;
-ms-overflow-style: none;

&::-webkit-scrollbar {
display: none;
}
}

:root {
--rp-c-text-code: var(--rp-c-brand-dark);
--rp-c-text-code-bg: #90998e1a;
Expand Down
7 changes: 6 additions & 1 deletion docs/rspress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ export default defineConfig({
},
plugins,
themeConfig: {
darkMode: true,
enableContentAnimation: true,
enableScrollToTop: true,
darkMode: !process.env.IS_SODOC,
socialLinks: [
{
icon: 'github',
Expand All @@ -139,6 +141,9 @@ export default defineConfig({
},
builderPlugins,
builderConfig: {
html: {
tags: [{ tag: 'script', children: "window.RSPRESS_THEME = 'light';" }],
},
output: {
cleanDistPath: true,
},
Expand Down
7 changes: 5 additions & 2 deletions docs/src/components/code-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ export function CodeBlock(props: Props) {
>
<div className="py-1 px-2 text-sm text-gray-5! dark:text-white!">{clipboard.copied ? 'Copied' : 'Copy'}</div>
</button>
{/* biome-ignore lint/security/noDangerouslySetInnerHtml: <explanation> */}
<div className={cn('m-0 overflow-scroll', codeClassName)} dangerouslySetInnerHTML={{ __html: html }} />
<div
className={cn('m-0 overflow-scroll hide-scrollbar', codeClassName)}
/* biome-ignore lint/security/noDangerouslySetInnerHtml: <explanation> */
dangerouslySetInnerHTML={{ __html: html }}
/>
</div>
)
}

0 comments on commit edd3ff0

Please sign in to comment.