cjohansen / portfolio

Eclipse Public License 1.0
222 stars 13 forks source link

Document and body classes not always being applied #18

Closed ShakoFarhad closed 5 months ago

ShakoFarhad commented 6 months ago

The classes defined below are not being applied when clicking on the button in the UI unless I add :background/background-color "var(--woodsmoke)". It can be any color of course. Despite setting :background/default-option-id :dark-mode, the initial mode class is also not being applied. It just applies the default classes and doesn't apply different class when trying to change to a different mode.

(ui/start!
  {:config
   {:background/options
    [{:id :light-mode
      :title "Light mode"
      :value {
              :background/document-class   "light"
              :background/body-class "light-mode"}}
     {:id :dark-mode
      :title "Dark mode"
      :value {:background/background-color "var(--woodsmoke)"
              :background/document-class   "dark"
              :background/body-class "dark-mode"}}]

    :background/default-option-id :dark-mode}})
cjohansen commented 5 months ago

Which version are you on? I fixed a similar issue recently, just want to check it's not the same.

ShakoFarhad commented 5 months ago

{:mvn/version "2023.12.07"} is the version I have been using.

cjohansen commented 5 months ago

The classes are always applied as far as I can tell. The background color is there to color Portfolio's part of the view. If you want a dark background color on the scene you can control that through the document class you choose. I tried to make this clearer in the relevant documentation, see the commit. It also explains why the default option appears to not work.