Revert broken flexbox after Branding component creation.
Inotial tree before Branding component:
<div class="region region-header">
<div class="block-system-branding-block">
so next styles worked:
.block-system-branding-block {
flex: 0 1 40%;
}
after branding component creation tree became:
<div class="region region-header">
<div class="block-system-branding-block">
<div class="branding">
so this marked is `useless`:
.branding {
flex: 0 1 40%;
}
Proposed resolution
1. Move flexbox child properties to higher level. EG: `block-system-branding-block`
OR
2. Rework branding component. But in this case according to BEM it shouldn't have any external geometry. And move that styles to `.region-header__branding`
Comments
Comment #2
chi commentedComment #3
nlisgo commented@Chi I'm not sure if you intended to link to a different related issue but this is currently linking to itself.
Comment #4
chi commentedRight. Added the correct one. Though I suspect those styles had become redundant before they were moved to SDC.
Comment #5
kostyashupenkoI 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
And add this margin or for child elements of `.branding` bem-block, or from some parent component, like `.header .branding { margin: 2.5rem 0; }`
Comment #6
chi commentedYou are right. A component should not define external geometry.
But what about other CSS rules? Here is the content of that file.
And the corresponding HTML.
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.
Comment #7
gauravvvv commentedI have removed some unused styles, attached interdiff for same.
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.
Comment #8
Harish1688 commentedHi,
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.
Tested steps:
1. Drupal 11 setup with Umami theme.
2. applied the patch and verified the patch changes.
Looks Good for RTBC+
Comment #9
smustgrave commentedPer testing #8
Comment #10
chi commentedStill think that the whole branding.css can be dropped.
Comment #11
lauriiiI 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 #3379522: Revert broken flexbox after Branding component creation 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.
Comment #12
chi commentedYou referenced this issue. I guess it supposed to be some other issue.
Comment #15
finnsky commentedFIxed position regression.
Comment #16
smustgrave commentedTested on mobile and see that the logo size changes
before
after
edit. wrong before picture.
Comment #17
finnsky commented@smustgrave Yes! This is exactly what was fixed. It was broken while branding component was created and now fixed.
Comment #18
finnsky commentedYou can see styles on place now.
https://gyazo.com/2b9fea383718076ba29d7db871b9b9ba
Comment #19
smustgrave commentedIssue summary and title should be updated if this is fixing a bug vs removing unused code please
Comment #20
finnsky commentedComment #21
finnsky commentedComment #22
finnsky commentedComment #23
smustgrave commentedThink this is ready for RTBC bucket.
Comment #26
lauriiiCommitted 8e56fd3 and pushed to 11.x. Also cherry-picked to 10.1.x. Thanks!