Skip to content
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

Merged
merged 4 commits into from
Apr 7, 2017
Merged

Change admin logo height to match breadcrumbs height #1822

merged 4 commits into from
Apr 7, 2017

Conversation

mtomov
Copy link
Contributor

@mtomov mtomov commented Apr 5, 2017

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
    admin logo before

  • After
    admin logo - after

Still looks a bit boxed, but oh well : )

  - adjusting to better vertical and horizontal align

  - remove unused css selectors
Copy link
Member

@tvdeyen tvdeyen left a 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%;
Copy link
Member

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;
Copy link
Member

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.

Copy link
Member

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;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also use the (to be introduced) $main-header-height variable to set the height on the .main-header

$main-header-height:             75px !default;
.main-header {
  ...
  height: $main-header-height;
  ...
}

That fixes the height for empty main headers, in the login screen for instance

Before

user sessions 2017-04-05 15-24-36

After

user sessions 2017-04-05 15-25-09

@@ -1,5 +1,5 @@
<header class="admin-nav-header">
<%= link_to spree.admin_path, class: 'brand-link' do %>
Copy link
Member

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.

Copy link
Member

@tvdeyen tvdeyen left a 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...

mtomov added 3 commits April 5, 2017 16:04
   - 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
@mtomov
Copy link
Contributor Author

mtomov commented Apr 5, 2017

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.

  • brand-link - well pointed out

  • line-height variable also fixed the login screen, well thought out 👍

There is nothing much different than before, but posting a screen nevertheless:

solidus logo after

Copy link
Member

@tvdeyen tvdeyen left a 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 👍

@tvdeyen tvdeyen modified the milestone: 2.2.0 Apr 6, 2017
Copy link
Contributor

@jhawthorn jhawthorn left a 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

@jhawthorn jhawthorn merged commit 93b2676 into solidusio:master Apr 7, 2017
@mtomov mtomov deleted the adjust-admin-logo-height branch April 8, 2017 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants