UX: better handling of logo size

This commit is contained in:
Joe 2018-11-23 22:04:42 +08:00 committed by GitHub
parent f402d0d74f
commit 336436dfb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 6 deletions

View File

@ -46,7 +46,6 @@ export default createWidget("home-logo", {
attributes: {
src: Discourse.getURL(logoSmallUrl),
width: 36,
height: 36,
alt: title
}
});
@ -61,7 +60,7 @@ export default createWidget("home-logo", {
} else if (logoUrl.length) {
return h("img#site-logo.logo-big", {
key: "logo-big",
attributes: { src: Discourse.getURL(logoUrl), height: 36, alt: title }
attributes: { src: Discourse.getURL(logoUrl), alt: title }
});
} else {
return h("h1#site-text-logo.text-logo", { key: "logo-text" }, title);

View File

@ -33,8 +33,6 @@
}
}
// the logo height is set in the home-logo widget. This ensures we get a scaled
// width that respects the aspect ratio of the image
#site-logo {
width: auto;
}

View File

@ -6,7 +6,9 @@
left: 0;
height: 4.2858em;
margin-bottom: 15px;
#site-logo {
height: 2.57em;
}
#site-text-logo {
font-size: $font-up-3;
margin: 0;

View File

@ -17,6 +17,9 @@
display: block;
}
}
#site-logo {
height: 2.4em;
}
#site-text-logo {
margin: 0;
font-size: $font-up-1;

View File

@ -6,7 +6,7 @@
<div class="logo-wrapper">
<a href="<%= path "/" %>">
<%- if application_logo_url.present? %>
<img src="<%= application_logo_url %>" height="36" alt="<%= SiteSetting.title %>" id="site-logo">
<img src="<%= application_logo_url %>" alt="<%= SiteSetting.title %>" id="site-logo">
<%- else %>
<h2 id='site-text-logo'><%= SiteSetting.title %></h2>
<%- end %>