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

View File

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

View File

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

View File

@ -6,7 +6,7 @@
<div class="logo-wrapper"> <div class="logo-wrapper">
<a href="<%= path "/" %>"> <a href="<%= path "/" %>">
<%- if application_logo_url.present? %> <%- 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 %> <%- else %>
<h2 id='site-text-logo'><%= SiteSetting.title %></h2> <h2 id='site-text-logo'><%= SiteSetting.title %></h2>
<%- end %> <%- end %>