Skip to content

Commit 1815701

Browse files
authored
webstie: 加明暗主题 (#135)
1 parent ced1afd commit 1815701

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@
3939
"react-dom": ">=16.8.0"
4040
},
4141
"devDependencies": {
42+
"@wcj/dark-mode": "^1.0.14",
4243
"@uiw/react-codesandbox": "^1.1.5",
4344
"@uiw/react-codepen": "^1.0.2",
4445
"markdown-react-code-preview-loader": "^2.1.2",
45-
"react-code-preview-layout": "^2.0.4",
46+
"react-code-preview-layout": "^2.0.6",
4647
"@kkt/less-modules": "~7.1.1",
4748
"@kkt/ncc": "~1.0.8",
4849
"@kkt/raw-modules": "~7.1.1",

website/App.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,9 @@
2020
.App-header p {
2121
max-width: 702px;
2222
padding: 25px 0 27px;
23-
}
23+
}
24+
dark-mode {
25+
position: fixed;
26+
left: 10px;
27+
top: 10px;
28+
}

website/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import GitHubCorners from '@uiw/react-github-corners';
33
import '@uiw/reset.css';
44
import './App.css';
55
import Page from './components/Markdown';
6+
import "@wcj/dark-mode"
67

78
const App: React.FC = () => {
89
return (
910
<div className="App">
11+
<dark-mode permanent></dark-mode>
1012
<GitHubCorners zIndex={9999} fixed href="https://github.com/uiwjs/react-split" />
1113
<header className="App-header">
1214
<h1 className="title">React Split</h1>

website/components/Markdown/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ const CodePreview: CodeComponent | ReactMarkdownNames = ({ inline, node, ...prop
3030
const code = data.data[metaId].value || '';
3131
const param = getURLParameters(meta);
3232
return (
33-
<CodeLayout ref={$dom}
33+
<CodeLayout
34+
ref={$dom}
3435
toolbarExtra={getToolbarExtra(code, param.codePen === "true", param.codeSandbox === "true")}
35-
toolbar={param.title || 'Example'} background={param.background} code={<pre {...rest} />} text={code}>
36+
toolbar={param.title || 'Example'} background={"transparent"} code={<pre {...rest} />} text={code}>
3637
<Child />
3738
</CodeLayout>
3839
);

0 commit comments

Comments
 (0)