Skip to content

Commit

Permalink
add doc for dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-yin committed Jul 7, 2024
1 parent 6419946 commit 1644edb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/source/dark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Dark Mode

This package has theme switching functionality. You can switch between light and dark mode by clicking the button in the top right corner of the page.

It will set something like `data-theme="dark"` to the root HTML element.

## Tailwind CSS

If your project use Tailwind CSS, please config `tailwind.config.js`

```js
module.exports = {
darkMode: ["selector", '[data-theme="dark"]'],
}
```

If TailwindCSS detect `data-theme="dark"` in the root HTML element, it will apply dark mode styles.
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ Topics
install_with_viewcomponent.md
write_preview.md
params.md
dark.md
contributing.md

0 comments on commit 1644edb

Please sign in to comment.