From 9e8ce4569e42d7553b561aa2a6facf54f04387c3 Mon Sep 17 00:00:00 2001 From: Ridhwana Date: Tue, 13 Oct 2020 17:41:31 +0200 Subject: [PATCH] SVG logo image re-sizing (#10826) * feat: add some heights and widths on the logo svg so any svg can be resized to fit in the header * chore: show a realistic view of the logo as per the header --- app/assets/stylesheets/components/header.scss | 7 +++++++ app/views/admin/configs/show.html.erb | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/components/header.scss b/app/assets/stylesheets/components/header.scss index 28b2979b9..d2de8a0d6 100644 --- a/app/assets/stylesheets/components/header.scss +++ b/app/assets/stylesheets/components/header.scss @@ -41,6 +41,7 @@ // Logo .site-logo { display: flex; + max-width: 20%; .logo { width: 50px; @@ -50,6 +51,12 @@ fill: var(--logo-color); border-radius: 3px; } + + svg { + height: calc(var(--header-height)); + width: auto; + padding: 0.5em; + } } // Search bar diff --git a/app/views/admin/configs/show.html.erb b/app/views/admin/configs/show.html.erb index c650959b1..f2535a9b2 100644 --- a/app/views/admin/configs/show.html.erb +++ b/app/views/admin/configs/show.html.erb @@ -552,7 +552,9 @@ placeholder: Constants::SiteConfig::DETAILS[:logo_svg][:placeholder] %>
<%= Constants::SiteConfig::DETAILS[:logo_svg][:description] %>
<% if SiteConfig.logo_svg.present? %> - <%= SiteConfig.logo_svg.html_safe %> + <% end %>