Skip to content

Conversation

@ljmnoonan
Copy link
Contributor

Odoo upped the contrast on a lot of things by making, for example, text $gray-900 instead of $gray-800. I did not dial this down as I did not think it was worth it to fight the trend and introduce hidden inconsistencies.

This PR, besides migration, also includes a fix to the device dependent dark mode setting. I feel that this is justified seeing that the new logic is a direct consequence of changes in 19.0, namely, that the decision on which asset bundle to load is made not by checking the color_scheme cookie, but rather by calling the color_scheme() method in ir_http. A full explanation of the new logic can be found in the last commit message.

fkantelberg and others added 30 commits January 4, 2026 01:43
Also, change asset bundle loading from 'prepend' to 'before' This is in line with Odoo's own way of doing it.
Also get rid of the bottom border.
If you go to any activity view and hover over an empty cell you will notice that
without this fix the the on hover background of empty cells (.o_activity_empty_cell) set by
$component-active-bg which is itself set as mix($o-action, $o-gray-100, 20%) through $o-component-active-bg
completely ignores the overrides we set in primary_variables.dark.scss.
This is because the assets for that view are lazy loaded, so we need to include our override
bundles in the lazy bundle.
Just general customizations of BS variables to bring them in line with our style
Add secondary_variables override to get rid of colors that don't jive well with the dark background.
Unfortunately this does introduce an issue where if you have many calendar users, you can run out of colors
This issue exists in the enterprise dark mode as well, so hopefully it will be fixed.
Set the background color to be darker and tone down the border around it.
The styling for the border is borrwed from the style of .o-mail-Composer-bg
Set attachment image background to white and fix the column background when hovering with a draggable card
…in forms

It was being set to $o-form-lightsecondary which I set lighter, so this tones it down a bit.
The relevant changes to odoo code:
odoo/odoo@2120e4c
1)
Fix calendar events with color_0 which is used for private tasks, for example.
Most noticable for private tasks in calendar view.
2)
Adjust bootstrap bg-subtle and text-emphasis for info, success, warning, and danger.
These are used for the epomnymous banners in html and in 19.0 for the purchase dashboard status cards.
.
Separate commit so that it can be backported to 18.0
@ljmnoonan
Copy link
Contributor Author

/ocabot migration web_dark_mode

I don't know if I can actually trigger this, but it's interesting to try :)

@OCA-git-bot
Copy link
Contributor

Sorry @ljmnoonan you are not allowed to mark the addon to be migrated.

To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons.

If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the maintainers key of its manifest.

@ljmnoonan ljmnoonan mentioned this pull request Jan 13, 2026
43 tasks
@pedrobaeza
Copy link
Member

You can become the maintainer of the module for triggering that bot commands.

/ocabot migration web_dark_mode

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Jan 14, 2026
@ljmnoonan
Copy link
Contributor Author

@pedrobaeza,
If you and and any other interested parties are ok with me having this role despite my low level of experience, I would be happy to be the maintainer for this module as it is something I will continue to work on and migrate.
I was unable to find a PSC specifically for this repo, so who makes the decision on maintainers?

@pedrobaeza
Copy link
Member

The PSC would be @OCA/web-maintainers

@ljmnoonan
Copy link
Contributor Author

@pedrobaeza
Ahh, I figured that there would be a PSC team separate from the maintainers team. thank you for pinging!

Previously, device dependent was strictly frontend and was set only if the
color_scheme cookie had not already been set. This meant that it was useless
unless you cleared your cookies.
This fix implements two separete methods of detecting device preference:
1) Server side
Adds request for Sec-CH-Prefers-Color-Scheme hint and uses it to serve up
the correct asset bundle on the first load. This is mostly just for Chromium
browsers.
2) Client side
If Sec-CH-Prefers-Color-Scheme is None, client side js will check
user.settings.dark_mode_device_dependent which, thanks to moving these prefs
to res_users_settings is already loaded without a separate orm call, if true
it will then check device preference and current cookie. If resetting the cookie
is required, it will then trigger a reload. This is, of course, very bad, as it
causes flicker and loads the assets twice, but thankfully it ony happens the first
time you login or enable device dependent, or if you switch your device's system
theme. This only applies to Firefox, Safari, or to Chromium browsers if the
user has enabled anti fingerprinting settings.

Sec-CH-Prefers-Color-Scheme docs are here:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-Prefers-Color-Scheme
@ljmnoonan ljmnoonan force-pushed the 19.0-mig-web_dark_mode branch from fd61687 to 5ef5802 Compare January 14, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.