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

Fix vertical centering of navbar logo #601

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jb3
Copy link
Member

@jb3 jb3 commented Oct 24, 2024

Commit 6d53df0 tried to address the logo leaking out of the navbar but incidentally seems to have pinned it to the top of the navbar.

Removing all manual positioning seems to leave Bootstrap happy enough to style it and so with just max-height: 40px; I see the following behavior in Firefox and Chromium.

image

diff --git a/templates/base.html b/templates/base.html
index 9c73904..3cd53e1 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -36,7 +36,7 @@
 <nav class="navbar navbar-expand-lg navbar-dark bg-dark" role="navigation">
   <div class="container">
       <a class="navbar-brand" href="{% if request.user.is_authenticated %}https://rigs.nottinghamtec.co.uk{%else%}https://nottinghamtec.co.uk{%endif%}">
-        <img src="{% static 'imgs/logo.webp' %}" class="mr-auto" style="max-height: 40px; position: absolute; left: 0.5em; top: 0;" alt="TEC's Logo: Serif 'TEC' vertically next to a blue box with the words 'PA and Lighting', surrounded by graduated rings" id="logo">
+        <img src="{% static 'imgs/logo.webp' %}" class="mr-auto" style="max-height: 40px;" alt="TEC's Logo: Serif 'TEC' vertically next to a blue box with the words 'PA and Lighting', surrounded by graduated rings" id="logo">
       </a>
       {% block titleheader %}
       {% endblock %}

I can't really figure out what would cause the rendering discrepancies on other platforms.

@FreneticScribbler
Copy link
Member

I'm not particularly a fan of it not being right in the far left corner though, hence the absolute position hack. Definitely agree it needs another look though 🤔

@jb3
Copy link
Member Author

jb3 commented Oct 26, 2024

On my version it is in-line with other nav items, not in the far left corner?

image

@FreneticScribbler
Copy link
Member

FreneticScribbler commented Oct 27, 2024

Sorry. Double negative made that confusing let me try again. My original intent was to have it in the far left corner, but because the navbar is only 80vw I had to be a bit hacky to get it there.

Open to the idea it'd be better where you have put it (certainly easier), but personally reluctant to adjust the original navbar layout.

@jb3
Copy link
Member Author

jb3 commented Oct 27, 2024

I have no preference really, I'll have a play around and see if I can get the old style with left pinning but with vertical centering, and without the overlapping that Isaac found yesterday on mobile devices:

image

@jb3 jb3 force-pushed the jb3/fixes/logo-vcentering branch from 7da259a to abd9f11 Compare October 29, 2024 13:24
@jb3
Copy link
Member Author

jb3 commented Oct 29, 2024

I can get it working nicely on desktop but it doesn't play nice with the extending nav on mobile at all, the woes of responsive design.

@FreneticScribbler
Copy link
Member

Yup, trying to design against so many targets is pain. I'll take another look myself at some point ...

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.

2 participants