feat(theme): allow to load a Docusaurus page with theme from query-string: ?docusaurus-theme=dark (#8708)

This commit is contained in:
Sébastien Lorber 2023-03-03 12:54:35 +01:00 committed by GitHub
parent 50b1dc7db3
commit 0f7552accb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 78 additions and 7 deletions

View file

@ -127,6 +127,17 @@ In light mode, the `<html>` element has a `data-theme="light"` attribute; in dar
}
```
:::tip
It is possible to initialize the Docusaurus theme directly from a `docusaurus-theme` query string parameter.
Examples:
- [`https://docusaurus.io/?docusaurus-theme=dark`](https://docusaurus.io/?docusaurus-theme=dark)
- [`https://docusaurus.io/docs/configuration?docusaurus-theme=light`](https://docusaurus.io/docs/configuration?docusaurus-theme=light)
:::
### Mobile View {#mobile-view}
Docusaurus uses `996px` as the cutoff between mobile screen width and desktop. If you want your layout to be different in the mobile view, you can use media queries.