Skip to content

Commit

Permalink
Merge pull request #637 from maykinmedia/fix/1494-fix-mobile-header-n…
Browse files Browse the repository at this point in the history
…avigation

💄 [#1494] Fix margins and designs in mobile navigation
  • Loading branch information
alextreme authored May 30, 2023
2 parents 02c654d + 94cbdd1 commit 5f78ccb
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
{% logo src=config.logo.file.url alt=logo_alt_text svg_height=75 %}

{% if request.user.is_authenticated %}
<span class="nav-login--icon">{% icon icon="how_to_reg" icon_position="before" icon_outlined=True %}</span>
<span class="nav-login--icon">{% icon icon="how_to_reg" icon_position="before" outlined=True %}</span>
{% elif config.login_show %}
<span class="nav-login--icon">
{% url 'login' as login_url %}
{% trans "Inloggen" as login %}
{% button text="Inloggen" href=login_url icon="person" icon_position="before" primary=True icon_outlined=True transparent=True %}
{% button text="" title="Inloggen" href=login_url icon="person" icon_position="before" primary=True icon_outlined=True transparent=True %}
</span>
{% endif %}

Expand Down
4 changes: 2 additions & 2 deletions src/open_inwoner/scss/components/Form/Form.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.form {
box-sizing: border-box;
display: grid;
gap: var(--gutter-width);
gap: var(--spacing-small);
padding: var(--gutter-width) 0;
position: relative;

@media (min-width: 768px) {
gap: var(--gutter-width);
gap: var(--spacing-large);
}

&#{&}--align-end {
Expand Down
3 changes: 2 additions & 1 deletion src/open_inwoner/scss/components/Grid/Grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@

&__welcome {
margin-bottom: var(--row-height);
margin-top: -80px;
background-color: var(--color-white);
box-shadow: 0 0 var(--row-height) 0 var(--color-mute);
box-shadow: 0 0 var(--row-height) 0 var(--color-gray);
padding: var(--spacing-large);
box-sizing: border-box;
width: 100%;
Expand Down
22 changes: 15 additions & 7 deletions src/open_inwoner/scss/components/Header/Header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ $vm: var(--spacing-large);

.header {
position: static;
min-height: 100px;
min-height: 81px;
background-color: var(--color-white);
width: 100%;
z-index: 1003;

@media (min-width: 768px) {
position: relative;
display: flex;
align-items: center;
min-height: 90px;
margin-bottom: var(--spacing-tiny);
}

Expand Down Expand Up @@ -80,6 +83,7 @@ $vm: var(--spacing-large);
position: static;
grid-row: 1;
grid-column: 6 / span 5;
margin-left: var(--spacing-large);
}

> .primary-navigation {
Expand All @@ -93,6 +97,7 @@ $vm: var(--spacing-large);
> .header__actions {
grid-column: 1 / span 12;
grid-row: 2;
margin-left: 0;
margin-bottom: var(--spacing-medium);

.form__control > .label .input {
Expand Down Expand Up @@ -219,8 +224,8 @@ $vm: var(--spacing-large);
max-height: calc(100% - (2 * var(--row-height)));
max-width: 100%;
overflow-y: auto;
padding: 0 var(--spacing-extra-large) var(--spacing-extra-large)
var(--spacing-extra-large);
padding: 0 var(--spacing-large) var(--spacing-extra-large)
var(--spacing-large);
position: fixed;
right: 0;
top: calc(2 * var(--row-height));
Expand Down Expand Up @@ -421,6 +426,7 @@ $vm: var(--spacing-large);
display: flex;
flex-direction: row;
overflow: initial;
margin: 0 0 var(--spacing-medium) var(--spacing-large);

.link--icon {
gap: var(--spacing-large);
Expand Down Expand Up @@ -467,8 +473,9 @@ $vm: var(--spacing-large);
margin: 0;

.header__text-actions {
padding: var(--spacing-medium) 0 var(--spacing-extra-large);
margin: var(--spacing-medium) 0 0 0;
padding: 0 0 0 var(--spacing-large);
margin: var(--spacing-large) 0 0 0;
width: calc(100% - (var(--spacing-extra-large)));

.p {
display: flex;
Expand All @@ -484,7 +491,7 @@ $vm: var(--spacing-large);
}

.form--inline {
padding: 19px 0 var(--spacing-extra-large);
padding: 0 0 var(--spacing-extra-large);
margin: 0;
}
}
Expand Down Expand Up @@ -522,7 +529,8 @@ $vm: var(--spacing-large);

.subpage-list {
margin-top: var(--spacing-extra-large);
margin-left: 11px;
margin-bottom: var(--spacing-medium);
margin-left: var(--row-height-big);
display: grid;
height: auto;
overflow: initial;
Expand Down
13 changes: 8 additions & 5 deletions src/open_inwoner/scss/components/Header/PrimaryNavigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
flex-direction: row;
justify-content: flex-start;
align-items: center;
margin-bottom: var(--spacing-medium);

@media (min-width: 768px) {
margin-bottom: 0;
}
}

@media (min-width: 768px) {
Expand All @@ -97,6 +102,8 @@
/// Dropdown triangles

&.primary-navigation__main .subpage-list {
left: -11px;

@media (min-width: 768px) {
&::before {
box-sizing: border-box;
Expand Down Expand Up @@ -210,11 +217,6 @@

/// Categories and authenticated nested list

&__main > &__list > &__list-item &__list {
@media (min-width: 768px) {
left: -11px;
}
}
&__authenticated > &__list > &__list-item &__list {
@media (min-width: 768px) {
right: 0;
Expand Down Expand Up @@ -283,6 +285,7 @@
@media (max-width: 767px) {
& > &__list > &__list-item > &__list.subpage-list {
margin-bottom: var(--spacing-medium);
margin-left: 2em;
}
}
}
4 changes: 4 additions & 0 deletions src/open_inwoner/search/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class SearchForm(forms.Form):
label=_("Organizations"), required=False, widget=forms.CheckboxSelectMultiple
)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["query"].widget.attrs["placeholder"] = _("Zoeken...")


class FeedbackForm(forms.ModelForm):
class Meta:
Expand Down

0 comments on commit 5f78ccb

Please sign in to comment.