Repository navigation
[18.0][IMP] web_company_color: match browser theme color - #3753
Open
LoisRForgeFlow wants to merge 1 commit into
Open
LoisRForgeFlow wants to merge 1 commit into
LoisRForgeFlow wants to merge 1 commit into
Conversation
Odoo hard-codes the theme-color meta tag to its default navbar color, so mobile browsers kept painting their address bar with it after the navbar was recolored. Use the active company's navbar color instead, compiled as SCSS so expressions like desaturate() also work. The active company is now taken only from the user's allowed companies, falling back to the current company.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Odoo hard-codes
<meta name="theme-color" content="#71639e"/>inweb.webclient_bootstrap. Mobile browsers (Chrome, Brave, Samsung Internet…) paint their address bar with it, so with this module the bar keeps Odoo's default purple while the navbar has the company color.This PR sets the meta tag to the active company's navbar background color:
ir.http.webclient_rendering_contextpasses the color to the template, and anxpathwithposition="attributes"setscontent. It falls back to#71639ewhen no navbar color is set.desaturate(#d2e1dd, 30%)give a real CSS color. The result is cached withormcache, so there is one compile per distinct value.res.company._get_web_company_color_active_company(). The asset bundle and the theme color now share it. The cookie company must be one of the user's allowed companies, otherwise it falls back toenv.company.Switching company reloads the page, so the bar color follows the company.