Repository navigation
Enhance : Make logo inherit the site background/gradient - #69693
Mayank-Tripathi32 wants to merge 5 commits into
Conversation
|
Can you please update the title and description so that it is clear that this pull request is not related to the site logo block. |
fda6e57 to
6685508
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @filipanoscampos. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Hi @t-hamano, Can you help me re-run the tests whenever possible? They been stuck for days now. |
9c49fa4 to
3cd6fd7
Compare
3cd6fd7 to
96b66b1
Compare
SirLouen
left a comment
There was a problem hiding this comment.
Test Report
Description
❌ This report can't validate that the indicated patch works as expected.
Environment
- WordPress: 7.0-alpha-61215-src
- PHP: 8.2.29
- Server: nginx/1.29.4
- Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.2.29)
- Browser: Chrome 143.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Three 1.6
- MU Plugins: None activated
- Plugins:
- Gutenberg 22.3.0
- Test Reports 1.2.1
Actual Results
- ❌ Issue failing with this patch.
Additional Notes
I've found one major issue
Using this Playground instance:
https://playground.wordpress.net/?gutenberg-branch=trunk&gutenberg-pr=69693&theme=twentytwentythree
Without site logo, this is the default:
But with this PR it looks like this
|
This was implemented back in #46736 when the editor looked like this
I truly believe that we could open a PR and switch from SiteIcon to the generic WordPress icon that looks better there. cc @youknowriad |
|
The logic is that the site icon used there is important in multi-site contexts to understand what site you're in. |
|
What do you think about applying the site background to the logo only when a custom site logo is used, and keeping the dark background otherwise? |
|
What's the idea behind applying the site background? I feel like the site logo is something that should stand on its own irrelevant of background (kind of like the site icon on browser tabs) so maybe I'm missing something but I don't really see why we should reflect the site background in the site icon. |
|
A typical problem is that the site icon is hard to see when it's gray:
Another approach was to add a stroke around the logo: #73816 |
|
I think we'd be just swapping some set of issues with another set of issues + a lot of added complexity. Nothing guarantees that the site icon applies well on top of the site top level background. |
Agreed. Or that the site logo is applied over the site background (could be within a header with a background color). |
Not sure if the logo is the ideal solution (for all the problems expressed here). I would have opted for a similar solution as the current admin dashboard (name of the site in the multisite). |
|
So should we close this PR, assuming the current behavior is correct? Or should we always show the W logo instead of the custom icon? |
The idea is definitely an improvement for the back button. The problem I see frequently is that we loosely expand the scope of the PR because someone notices something else, and then the whole discussion ends at a frustration point when we consider closing it all around. I truly believe that this must fix the back button issue. As soon as de logo color collides with the default background of the back button, it will be a monocolor weird square. The PR is heading in the right direction but still needs more of work. For the little logo in the editor that @jasmussen commented on, open or ignore with a future PR. Don't try to kill 2 birds with one stone. |
|
Feel free to unblock this. I cannot unblock it myself other than accepting changes. |
|
I'd love to see this land so that transparent black PNG logos are visible as "back" buttons. |
|
So, Are we moving forward with this solution? Or should we close this? I am honestly a bit out of touch here considering this PR has been up for almost a year. I would be happy to retest and rebase the PR if we plan to move forward. |
I feel like we have tried the other mechanisms: adding a stroke, etc. And the issue still feels valid: you can upload a black, transparent PNG as site logo, which makes it illegible. Between both of those, I feel the solution proposed here, at least functionally, is the most promising path forward, and if you'd be up for it, I'd welcome a rebase. |
I think we need to explore how to address this issue. For example, if a site has a white background, a black header background, and a site logo is placed inside the header, the site logo will likely be close to white. However, if we apply the site's white background to that icon, it will likely become invisible. |
Very valid, but do you think the BG could still be a starting point? It seems the simplest alternative to what we've tried, that will work in most contexts. |
|
For me it's really not clear to me whether this will work in most contexts than what we already have in trunk. If any I feel it works in less contexts, and the solution to update the logo of the site is less drastic than updating the design of the site. |
…ean up styles. - Added global styles support for the button background and text color based on the current theme. - Removed hardcoded background color from the SCSS file to allow for dynamic styling. - Improved code readability and organization in fullscreen-mode-close.js.
…improve styling logic. - Added support for global styles in the SiteIcon component to dynamically set background and text colors. - Updated the EditSiteEditor to utilize global styles for the view mode toggle icon. - Removed hardcoded background color from the SiteIcon styles to allow for dynamic styling based on the current theme. - Improved the SiteIcon component to accept a style prop for better customization.
Added the original border effect on hover
a614c69 to
572c3f8
Compare
|
I have refreshed with trunk, I do feel that if we are not sure on this then it be best to avoid shipping this for now. Maybe explore possibility of detecting transparent logos and forcing a static color on them? Maybe add another way to control this via site logo component, User can pick bg color for logo? |
|
I wonder: with the adminbar now everywhere, is this issue still relevant? |
|
At the very least, the site logo should no longer be present in the UI rendered by Gutenberg, so I don't think this issue needs to be addressed anymore. |







Fixes #49501
What?
When a user uploads an image to the Site Logo block for the first time, a square crop of that image is also used as the Site Icon. In common setups—like sites with white logos on transparent backgrounds and dark text—this results in a barely visible site icon.
To solve this, we apply the site's background color behind the site logo image directly via inline styles. This ensures that the logo maintains its intended contrast regardless of transparency in both site editor and post editor.
Why?
How?
I used the internal globalStylesDataKey from the block editor’s private APIs to fetch the global styles set in the Site Editor. Then, we applied the background and text color directly to the image element within the Site Logo block using inline styles:
This ensures the logo always renders on a background consistent with the site's design system.
ScreenShots