Issue #3444391: Center align logo on collapsed toolbar.
Closes #3444391
Merge request reports
Activity
371 371 display: none; 372 372 } 373 373 } 374 375 html[data-admin-toolbar="collapsed"] { few suggestions here.
- no need to rise specificity with
html
- probably use same
:where
in header and logo elements https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/navigation/css/components/admin-toolbar.pcss.css?ref_type=heads#L366 - i would better use
max-width
forimg
- no need to rise specificity with
changed this line in version 3 of the diff
added 1 commit
371 371 display: none; 372 372 } 373 373 } 374 375 :where([data-admin-toolbar="collapsed"]) { changed this line in version 5 of the diff
added 128 commits
-
1794cdad...81ff548f - 122 commits from branch
project:11.x
- 9a2a1112 - Center align logo on collapsed toolbar.
- c322bc4f - Add width to logo on collapsed toolbar.
- da7db1e5 - Issue#3444391: Update the css selector in admin toolbar.
- 93aef826 - Use :where.
- ba5cab1b - Update file admin-toolbar.pcss.css
- 5142e594 - Update styles and fix pipeline.
Toggle commit list-
1794cdad...81ff548f - 122 commits from branch
242 247 & img { 243 248 display: block; 244 249 } 250 251 :where([data-admin-toolbar="collapsed"]) & { 252 > img { 253 max-width: 40px; Just my thoughts - i think that most of logos in the entire world are horizonal, than vertical. Ot at least squares. So i would limit height instead of width, and would make width:
auto
Edited by Konstantin Shupenkochanged this line in version 9 of the diff
242 247 & img { 243 248 display: block; 244 249 } 250 251 :where([data-admin-toolbar="collapsed"]) & { 252 > img { fyi [#3436526] should hopefully be merged very shortly and preps around a max-width (always).
undersized images probably need a centered in the a tag itself as something needs to retain a 40px hit size (normal 'finger size')
changed this line in version 9 of the diff
added 87 commits
-
5f47994d...62f9af40 - 80 commits from branch
project:11.x
- 6af48b47 - Center align logo on collapsed toolbar.
- dc0c099b - Add width to logo on collapsed toolbar.
- 04c4d7ca - Issue#3444391: Update the css selector in admin toolbar.
- 9d8605e5 - Use :where.
- ef9b4feb - Update file admin-toolbar.pcss.css
- 2b27bb80 - Update styles and fix pipeline.
- 33145eb7 - Set max-width on img container.
Toggle commit list-
5f47994d...62f9af40 - 80 commits from branch
246 251 display: block; 247 252 max-width: var(--admin-toolbar-space-40); 248 253 } 254 255 :where([data-admin-toolbar="collapsed"]) & { 256 max-width: var(--admin-toolbar-space-40); yes, I had fixed max width in the branch with the fix for disconnected file, other use of this in this branch would be unnecessary now. this branch has noise now that it's merged in..
- the a href itself should be 40x40 (size of a finger tip touch), then v/h center the img itself in the href the image and keep it padded should work thru better.
- when/with the logo crop (#3436526) this issue only needs to consider smaller image.
.admin-toolbar__logo { .... & img { display: block; max-width: var(--admin-toolbar-space-40); } }
Edited by skaught