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

Used flex instead of floats for header layout #1523

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion djangoproject/scss/_dark-mode.scss
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ html[data-theme="light"] .theme-toggle .theme-label-when-light {
line-height: 45px;
text-align: center;
margin: 4px 10px;
float: right;

@include respond-min(768px) {
display: none;
Expand Down
9 changes: 4 additions & 5 deletions djangoproject/scss/_style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -474,22 +474,24 @@ blockquote {
z-index: 0;

.container {
display: flex;
flex-direction: row;
@include respond-min(768px) {
position: relative;
}
}

.spacer {flex: 1}

.meta {
@include font-size(13);
color: var(--primary);
font-weight: 700;
width: auto;
float: left;
margin: 8px 0 0 10px;
display: none;

@include respond-min(1150px) {
float: left;
width: 200px;
display: block;
}
Expand All @@ -503,7 +505,6 @@ blockquote {
background: url(../img/logo-django.png) 0 0 no-repeat;
color: var(--white-color);
display: block;
float: left;
font-weight: 700;
margin: 10px;
overflow: hidden;
Expand All @@ -529,7 +530,6 @@ blockquote {
color: var(--menu);
cursor: pointer;
display: block;
float: right;
height: 45px;
line-height: 48px;
margin: 4px 10px;
Expand Down Expand Up @@ -563,7 +563,6 @@ blockquote {

@include respond-min(768px) {
width: auto;
float: right;
max-height: none; // always show menu on a desktop width
}

Expand Down
9 changes: 5 additions & 4 deletions djangoproject/templates/includes/header.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<div role="banner" id="top">
<div class="container">
<div class="container container--flex--wrap--mobile">
<a class="logo" href="{% url 'homepage' %}">Django</a>
<p class="meta">The web framework for perfectionists with deadlines.</p>
<div class="spacer"></div>
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't like having this in the HTML but I couldn't figure out how to achieve the same result with CSS only. Suggestions welcome!

<div class="mobile-toggle">
{% include "includes/toggle_theme.html" %}
</div>
<button class="menu-button">
<i class="icon icon-reorder"></i>
<span class="visuallyhidden">Menu</span>
</button>
<div class="mobile-toggle">
{% include "includes/toggle_theme.html" %}
</div>
<div role="navigation">
<ul>
<li{% if 'start' in request.path %} class="active"{% endif %}>
Expand Down