Skip to content

Commit

Permalink
Merge pull request #12 from rails-inspire-django/feature/10
Browse files Browse the repository at this point in the history
add doc for dark mode
  • Loading branch information
michael-yin authored Jul 7, 2024
2 parents 6419946 + 1644edb commit f6bcc62
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 f6bcc62

Please sign in to comment.