Skip to content

feat:加明暗主题 #135

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

Merged
merged 1 commit into from
Jul 9, 2022
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@
"react-dom": ">=16.8.0"
},
"devDependencies": {
"@wcj/dark-mode": "^1.0.14",
"@uiw/react-codesandbox": "^1.1.5",
"@uiw/react-codepen": "^1.0.2",
"markdown-react-code-preview-loader": "^2.1.2",
"react-code-preview-layout": "^2.0.4",
"react-code-preview-layout": "^2.0.6",
"@kkt/less-modules": "~7.1.1",
"@kkt/ncc": "~1.0.8",
"@kkt/raw-modules": "~7.1.1",
Expand Down
7 changes: 6 additions & 1 deletion website/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@
.App-header p {
max-width: 702px;
padding: 25px 0 27px;
}
}
dark-mode {
position: fixed;
left: 10px;
top: 10px;
}
2 changes: 2 additions & 0 deletions website/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import GitHubCorners from '@uiw/react-github-corners';
import '@uiw/reset.css';
import './App.css';
import Page from './components/Markdown';
import "@wcj/dark-mode"

const App: React.FC = () => {
return (
<div className="App">
<dark-mode permanent></dark-mode>
<GitHubCorners zIndex={9999} fixed href="https://github.com/uiwjs/react-split" />
<header className="App-header">
<h1 className="title">React Split</h1>
Expand Down
5 changes: 3 additions & 2 deletions website/components/Markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ const CodePreview: CodeComponent | ReactMarkdownNames = ({ inline, node, ...prop
const code = data.data[metaId].value || '';
const param = getURLParameters(meta);
return (
<CodeLayout ref={$dom}
<CodeLayout
ref={$dom}
toolbarExtra={getToolbarExtra(code, param.codePen === "true", param.codeSandbox === "true")}
toolbar={param.title || 'Example'} background={param.background} code={<pre {...rest} />} text={code}>
toolbar={param.title || 'Example'} background={"transparent"} code={<pre {...rest} />} text={code}>
<Child />
</CodeLayout>
);
Expand Down