Commit Graph

7 Commits

Author SHA1 Message Date
Masen Furer
aa2a1df201
Add vars and components for working with color_mode (#1132)
* `pc.color_mode`: a BaseVar that accesses colorMode on the frontend
* `pc.color_mode_cond`: a `pc.cond` wrapper that conditionally renders
  components or props based on the value of `color_mode`
* `pc.color_mode_icon`: by default "sun" if light mode, "moon" if dark mode
* `pc.color_mode_switch`: a Switch component where is_checked depends on the
  color_mode and changing the value calls toggle_color_mode
* `pc.color_mode_button`: a Button component that calls toggle_color_mode on click

The default template has been updated to include a color_mode_button with
color_mode_icon for toggling light/dark mode. The inline hover style has also
been updated to use color_mode_cond to show a different highlight color based
on the color_mode.
2023-06-11 23:28:33 -07:00
iron3oxide
32f3a387ae
Rename var module to vars (#983) 2023-05-09 23:01:25 -07:00
iron3oxide
7067baf176
Refactor utils module (#666) 2023-03-16 14:59:27 -07:00
叶子
1529a23c1b
Switch linter to ruff (#450) 2023-02-09 11:33:18 -08:00
Nikhil Rao
6b97de71a0
Fix format route and code cleanup (#399) 2023-01-30 14:35:06 -08:00
advo-kat
41fffe677b
Add support for toggling color mode ('night/day mode') (#382)
Co-authored-by: g0ee <0@g0.ee>
Co-authored-by: g0ee <adbokat.b.a.s.e@gmail.com>
2023-01-30 12:39:32 -08:00
Nikhil Rao
e8e8eaa010 Initial commit. 2022-11-18 12:44:06 -08:00