-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change admin logo height to match breadcrumbs height #1822
Conversation
- adjusting to better vertical and horizontal align - remove unused css selectors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I think we can enhance this even more.
img { | ||
vertical-align: middle; | ||
max-width: 100%; | ||
max-height: 100%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not remove the max-width
and max-height
rules, otherwise large images will pop out of the div.
height: 58px; // height of .page-title | ||
box-sizing: content-box; | ||
background-color: $color-1; | ||
padding: 14px 0 8px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using (also asynchronous) padding we should use line-height
to vertically align the image in the box and remove all the padding. This has the advantage that images could consume the whole available space if they like.
We can fix the padding of the default logo by removing the extra whitespace from the image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The solution I came up with
.admin-nav-header {
padding: 0;
border-bottom: 1px solid $color-border;
text-align: center;
// Using line height for proper vertical centering.
// As line height does not take the border width into account we need to subtract it.
line-height: $main-header-height - 1px;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1,5 +1,5 @@ | |||
<header class="admin-nav-header"> | |||
<%= link_to spree.admin_path, class: 'brand-link' do %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shops may have used this class for deface overrides. We should not remove it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meh GitHub, why you don't let me change the type of review later on...
- to unify the with the header size - and "automatically" apply vertical center to the image -> fixes a mis-alignment on headers without text as suggested by @tvdeyen
- Using @include img-fluid(); doesn't actually work, because it defaults to `display: inline-block`, which is not what we want. - Thereby, source the definition of responsive image from Foundation: https://github.com/zurb/foundation-sites/blob/develop/scss/_global.scss#L154-L163
- available for replace by Deface overrides - as well pointed out by @tvdeyen
Super, actually no logo resize was necessary after the line-height change .. which is good, as I didn't want to mess the frontend somehow. I've allowed myself one more try with an automatic image resize in d2d0b89 . Reason is that I think that nowadays all images should be responsive, like in foundation. I'm not sure to what extend that would apply for such a project, but I've browsed through some product images, and everything looks normal, so it's pending your decision on this "global" one.
There is nothing much different than before, but posting a screen nevertheless: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please remove the fixup commits and squash them into the previous commits instead?
Besides that 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
The image itself seemed to contain white space underneath, so have modified the padding values accordingly to vertically center it.edit: uses line-height now, see conversation.
Removed a bit of css as well.
Before
After
Still looks a bit boxed, but oh well : )