mirror of
https://github.com/logseq/logseq.git
synced 2026-04-30 08:56:29 +00:00
refactor: add theme container & lift the dark/light class scope to root & restore scrollbar style.
This commit is contained in:
12
src/main/frontend/components/theme.cljs
Normal file
12
src/main/frontend/components/theme.cljs
Normal file
@@ -0,0 +1,12 @@
|
||||
(ns frontend.components.theme
|
||||
(:require [rum.core :as rum]))
|
||||
|
||||
(rum/defc container
|
||||
[{:keys [theme on-click] :as props} child]
|
||||
(rum/use-effect! #(-> js/document.documentElement
|
||||
(.setAttribute "data-theme" theme))
|
||||
[theme])
|
||||
[:div
|
||||
{:class (str theme "-theme")
|
||||
:on-click on-click}
|
||||
child])
|
||||
Reference in New Issue
Block a user