web icon indicating copy to clipboard operation
web copied to clipboard

[18.0][MIG] web_dark_mode: Migration to 18.0

Open ljmnoonan opened this issue 2 months ago • 6 comments

This PR includes and supersedes #3267 with the permission of @len-foss.

Migrates web_dark_mode from 16 to 18 and overhauls the SCSS not only to look better, but also to correspond to Odoo's native structure as seen in the web module.

As with the previous version, its scope is limited to the backend, and so has no effect on POS or website.

Also, I have submitted #3322 to make web_theme_classic get along with this dark mode hope to do the same for web_responsive soon.

Looking forward to any feedback!

image image image image image image image image image image image

ljmnoonan avatar Oct 16 '25 15:10 ljmnoonan

Thanks, it works for me.

Did you test the dashboard? The background is white.

mathben avatar Oct 17 '25 02:10 mathben

Did you test the dashboard? The background is white.

The dashboard is, unfortunately, mostly canvas elements that I presume are rendered by JavaScript somewhere. I didn't look into it too much this time, but hopefully I'll be able to get it sorted later. This problem existed in version 16 as well.

ljmnoonan avatar Oct 17 '25 06:10 ljmnoonan

FWIW, I have this in lambdao_web's ui.scss:

.app-menu-container {
  background-image: url(/lambdao_web/static/src/img/logo_grey.svg) !important;
  background-position: bottom right !important;
  background-repeat: no-repeat !important;
  background-size: 10% !important;
  background-color: #899499 !important;
}

and this in ui_dark.scss:

 .app-menu-container {
   background-color: #213330 !important;
 }

in any case, you don't need any JS to fix that. I had put a bunch of theme fixes for all the things I found egregious, this one being the worst offender :-)

len-foss avatar Oct 17 '25 07:10 len-foss

@len-foss Thank you for pointing that out! I'll try to get it fixed.

ljmnoonan avatar Oct 17 '25 08:10 ljmnoonan

@len-foss, app-menu-container class is from web_responsive, the app switcher dashboard as far as I can tell. I am working on a PR for a dark mode for web responsive too, but @mathben and I were referring to the dashboards module earlier.

image

Now, I am not very good with javascript, but it does seem that this is all being rendered in o_spreadsheet.js and the styles that are controlled by SCSS are deliberately set to stay in light mode even when dark mode is active in o_spreadsheet_extended.dark.scss the first lines of which contain a comment mentioning that odoo does not currently have an adequate toolchain to support darkmode in spreadsheet. I am not going to pursue this any further at the moment as it looks like a ton of work, and something that should actually be contributed upstream to odoo anyways.

ljmnoonan avatar Oct 21 '25 10:10 ljmnoonan

Oh sorry for the confusion. After the previous message I saw that I had a bunch of "fixes" to the dark mode, but without proper doc on chat it was. I agree with your analysis :+1:

len-foss avatar Oct 21 '25 10:10 len-foss

Can you review please @legalsylvain @yajo @LoisRForgeFlow Thanks you!

mathben avatar Dec 09 '25 02:12 mathben