- Issue created by @Chi
- 🇬🇧United Kingdom nlisgo
@Chi I'm not sure if you intended to link to a different related issue but this is currently linking to itself.
- 🇷🇺Russia Chi
Right. Added the correct one. Though I suspect those styles had become redundant before they were moved to SDC.
- Status changed to Needs review
over 1 year ago 7:05am 7 August 2023 - last update
over 1 year ago 29,953 pass - 🇷🇺Russia kostyashupenko Omsk
I agree, so it's removed now. But i'm thinking globally about this - we are using BEM methodology, and BEM says that block-level element shouldn't have positioning styles. Normally speaking - branding component doesn't know where it will be displayed. In header, or in footer, or somewhere else. So normally except of removing `flex` property i also have to remove
.branding { margin: 2.5rem 0; }
And add this margin or for child elements of `.branding` bem-block, or from some parent component, like `.header .branding { margin: 2.5rem 0; }`
- 🇷🇺Russia Chi
You are right. A component should not define external geometry.
But what about other CSS rules? Here is the content of that file.
/** * @file * This file is used to style the branding block. */ .branding { flex: 0 1 40%; } @media screen and (min-width: 48em) { .branding { flex: 0 1 220px; margin: 2.5rem 0; text-align: left; } } .branding__site-logo { display: inline-block; width: 100%; max-width: 205px; background-color: inherit; } .branding__site-logo:hover, .branding__site-logo:focus { background-color: inherit; } .branding__site-logo svg { width: 100%; max-width: 205px; height: auto; }
And the corresponding HTML.
<div class="branding"> <a href="/umami/web/en" rel="home" class="branding__site-logo"> <img src="/umami/web/core/profiles/demo_umami/themes/umami/logo.svg" alt="Home"> </a> </div>
Could you find a single line here that still makes sense, besides the margin?
Note that the component has no any text nodes. And the logo is rendered via img tag.
- last update
over 1 year ago 29,953 pass - 🇮🇳India gauravvvv Delhi, India
I have removed some unused styles, attached interdiff for same.
.branding__site-logo:hover, .branding__site-logo:focus { background-color: inherit; }
This code is required, If we eliminate the background, the background color appears on the anchor tag. This will also modify the background color of the logo image.
a:hover, a:focus { color: #cc2a00; background-color: #e6eee0; }
Hi,
Tested the patch 3379522-7.patch from comment #7, and found unused styles in Umami branding component are removed successfully from the file without any UI impact on design.
Also tested the this code, it will also modify the background color of the logo image.
a:hover, a:focus { color: #cc2a00; background-color: #e6eee0; }
Tested steps:
1. Drupal 11 setup with Umami theme.
2. applied the patch and verified the patch changes.Looks Good for RTBC+
- Status changed to RTBC
over 1 year ago 9:19pm 16 August 2023 - last update
over 1 year ago 29,967 pass - Status changed to Needs work
over 1 year ago 6:50am 17 August 2023 - 🇫🇮Finland lauriii Finland
I think this is unused at the moment but this was added for a reason; to reduce the size of the logo on mobile. Looks like 🐛 Revert broken flexbox after Branding component creation Fixed caused a regression to the mobile styles. Maybe we should repurpose this issue to address that regression? It's also a good opportunity for us to figure out how we want to handle layouts with components.
- 🇷🇺Russia Chi
Looks like #3379522: Unused styles in Umami branding component caused a regression to the mobile styles.
You reference this issue. I guess it supposed to be some other issue.
- First commit to issue fork.
- Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
about 1 year ago Not currently mergeable. - @finnsky opened merge request.
- last update
about 1 year ago 30,135 pass - Status changed to Needs review
about 1 year ago 10:22am 2 September 2023 - Status changed to Needs work
about 1 year ago 8:09pm 3 September 2023 - 🇺🇸United States smustgrave
Tested on mobile and see that the logo size changes
before
after
- Status changed to Needs review
about 1 year ago 9:54pm 3 September 2023 - 🇷🇸Serbia finnsky
@smustgrave Yes! This is exactly what was fixed. It was broken while branding component was created and now fixed.
- 🇷🇸Serbia finnsky
You can see styles on place now.
https://gyazo.com/2b9fea383718076ba29d7db871b9b9ba - Status changed to Needs work
about 1 year ago 12:35am 4 September 2023 - 🇺🇸United States smustgrave
Issue summary and title should be updated if this is fixing a bug vs removing unused code please
- Status changed to Needs review
about 1 year ago 5:49am 4 September 2023 - Status changed to RTBC
about 1 year ago 5:02pm 4 September 2023 - last update
about 1 year ago 30,136 pass - last update
about 1 year ago 30,136 pass - Status changed to Fixed
about 1 year ago 8:55am 8 September 2023 Automatically closed - issue fixed for 2 weeks with no activity.