Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(theme): allow to load a Docusaurus page with theme from query-st…
…ring: ?docusaurus-theme=dark (#8708)
- Loading branch information
Showing
5 changed files
with
78 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import Layout from '@theme/Layout'; | ||
import Heading from '@theme/Heading'; | ||
import BrowserWindow from '@site/src/components/BrowserWindow'; | ||
|
||
function IframeTest({url}: {url: string}) { | ||
return ( | ||
<div style={{padding: 10}}> | ||
<BrowserWindow | ||
url={url} | ||
style={{minWidth: '40vw', maxWidth: 400}} | ||
bodyStyle={{padding: 0}}> | ||
<iframe src={url} title={url} style={{width: '100%', height: 300}} /> | ||
</BrowserWindow> | ||
</div> | ||
); | ||
} | ||
|
||
// See https://github.com/facebook/docusaurus/issues/8672 | ||
export default function Embeds(): JSX.Element { | ||
return ( | ||
<Layout> | ||
<div style={{padding: 10}}> | ||
<Heading as="h1">Test Embeds</Heading> | ||
<div style={{display: 'flex', flexWrap: 'wrap'}}> | ||
<IframeTest url="/?docusaurus-theme=light" /> | ||
<IframeTest url="/?docusaurus-theme=dark" /> | ||
<IframeTest url="/?docusaurus-theme=unexpected-value" /> | ||
<IframeTest url="/" /> | ||
<IframeTest url="https://docusaurus.io/" /> | ||
<IframeTest url="https://tutorial.docusaurus.io/" /> | ||
</div> | ||
</div> | ||
</Layout> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters