Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add bootstrap grid to header

Krzysztof Białogłowiczbf00ca217f4c
diff --git a/saleor/static/scss/storefront/components/_cart-dropdown.scss b/saleor/static/scss/storefront/components/_cart-dropdown.scss
index 1caa34faad..8e484216e8 100644
--- a/saleor/static/scss/storefront/components/_cart-dropdown.scss
+++ b/saleor/static/scss/storefront/components/_cart-dropdown.scss
@@ -12,7 +12,7 @@
padding-bottom: $global-padding * 2;
box-shadow: 3px 3px 3px 0px rgba($gray, 0.75);
max-height: 28rem;
- overflow-y: scroll;
+ overflow-y: auto;
}
a {
color: $body-color;
@@ -35,8 +35,8 @@
width: 15px;
height: 10px;
position: absolute;
- top: 47px;
- right: 25px;
+ top: 54px;
+ right: 10px;
background-color: $light-gray;
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
diff --git a/saleor/static/scss/storefront/components/_header.scss b/saleor/static/scss/storefront/components/_header.scss
index 5947d4459b..283cf99666 100644
--- a/saleor/static/scss/storefront/components/_header.scss
+++ b/saleor/static/scss/storefront/components/_header.scss
@@ -37,17 +37,13 @@
z-index: 4;
border-bottom: 1px solid $gray;
}
- .container {
- position: relative;
- }
&__cart {
@include media-breakpoint-up(md) {
- margin-top: $global-margin / 2;
+ line-height: 2.4rem;
}
&__icon {
margin-left: $global-margin;
}
- margin-right: $global-margin;
a {
color: $body-color;
position: relative;
@@ -81,11 +77,8 @@
padding-left: $global-padding;
}
&__search {
- max-width: 50%;
- width: 40%;
+ width: 100%;
position: relative;
- margin-right: 10%;
- margin-top: $global-margin / 2;
.mobile-close-search {
position: absolute;
top: 1.9rem;
@@ -93,14 +86,14 @@
max-width: 22px;
cursor: pointer;
}
- .form-control {
+ .search-input {
width: 100%;
border-color: $body-color;
}
.btn {
position: absolute;
- top: 0.25rem;
- right: 0.25rem;
+ right: 0.5rem;
+ border: 0;
img {
max-height: 1.5rem;
}
diff --git a/templates/base.html b/templates/base.html
index 7bf7211c9e..f664c96961 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -62,32 +62,40 @@
</div>
<div class="navbar__brand">
<div class="container">
- <img class="hidden-md-up navbar__brand__menu-toggle closed open" src="{% static "images/mobile-bar.svg" %}">
- <a href="/">
- <img src="{% static "images/saleor-logo-black.svg" %}" alt="Testeor - Saleor demo store" height="40">
- </a>
- <div class="float-right">
- {% if SEARCH_IS_ENABLED %}
- <img class="hidden-md-up mobile-search-icon" src="{% static "images/search-icon.svg" %}">
- {% endif %}
- <div class="navbar__brand__cart float-right">
- <a href="{% url "cart:index" %}">
- <span class="hidden-sm-down">{% trans "Your cart" %}</span>
- <img class="navbar__brand__cart__icon" src="{% static "images/cart.svg" %}" alt="Cart">
- <span class="badge {% if not cart_counter %}hidden-xs-up{% endif %}">{{ cart_counter }}</span>
+ <div class="row">
+ <div class="col-3">
+ <img class="hidden-md-up navbar__brand__menu-toggle closed open" src="{% static "img/mobile-bar.svg" %}">
+ <a href="/">
+ <img src="{% static "img/saleor-logo-black.svg" %}" alt="Testeor - Saleor demo store" height="38">
</a>
- <div class="cart-dropdown hidden-md-down">
- {% include 'cart-dropdown.html' %}
+ </div>
+ <div class="col-6">
+ {% if SEARCH_IS_ENABLED %}
+ <form class="form-inline navbar__brand__search" action="{% url "search:search" %}">
+ <img class="mobile-close-search hidden-md-up" src="{% static "img/close-icon.svg" %}">
+ <input class="form-control search-input" type="text" placeholder="Search" name="q" value="{% if query %}{{ query }}{% endif %}">
+ <button class="btn btn-link" type="submit">
+ <img src="{% static "img/search-icon.svg" %}">
+ </button>
+ </form>
+ {% endif %}
+ {% if SEARCH_IS_ENABLED %}
+ <img class="hidden-md-up mobile-search-icon" src="{% static "img/search-icon.svg" %}">
+ {% endif %}
+ </div>
+ <div class="col-3">
+ <div class="navbar__brand__cart float-right">
+ <a href="{% url "cart:index" %}">
+ <span class="hidden-sm-down">{% trans "Your cart" %}</span>
+ <img class="navbar__brand__cart__icon" src="{% static "img/cart.svg" %}" alt="Cart">
+ <span class="badge {% if not cart_counter %}hidden-xs-up{% endif %}">{{ cart_counter }}</span>
+ </a>
+ <div class="cart-dropdown hidden-md-down">
+ {% include 'cart-dropdown.html' %}
+ </div>
</div>
</div>
</div>
- {% if SEARCH_IS_ENABLED %}
- <form class="form-inline float-right navbar__brand__search" action="{% url "search:search" %}">
- <img class="mobile-close-search hidden-md-up" src="{% static "images/close-icon.svg" %}">
- <input class="form-control" type="text" placeholder="Search" name="q" value="{% if query %}{{ query }}{% endif %}">
- <button class="btn btn-link" type="submit"><img src="{% static "images/search-icon.svg" %}"></button>
- </form>
- {% endif %}
</div>
</div>