Skip to content

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

Add styles to search no results page

Krzysztof Białogłowicza646b11c91f5
diff --git a/saleor/static/scss/storefront/components/_search.scss b/saleor/static/scss/storefront/components/_search.scss
new file mode 100644
index 0000000000..7956eeb9a9
--- /dev/null
+++ b/saleor/static/scss/storefront/components/_search.scss
@@ -0,0 +1,28 @@
+.search_results {
+ .no-results {
+ max-width: 30rem;
+ margin: auto;
+ h2 {
+ text-align: center;
+ padding-top: $global-padding;
+ padding-bottom: $global-padding/2;
+ font-size: 2.5rem;
+ @include media-breakpoint-down(sm) {
+ font-size: 1.5rem
+ }
+ }
+ img {
+ width: 100%;
+ padding-bottom: $global-padding*2;
+ }
+ p {
+ text-align: center;
+ margin-bottom: 0;
+ font-size: 1.5rem;
+ @include media-breakpoint-down(sm) {
+ font-size: 1rem
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/saleor/static/scss/storefront/storefront.scss b/saleor/static/scss/storefront/storefront.scss
index ddd6a31663..486f78f9b5 100644
--- a/saleor/static/scss/storefront/storefront.scss
+++ b/saleor/static/scss/storefront/storefront.scss
@@ -18,4 +18,5 @@
@import "components/product-list";
@import "components/checkout";
@import "components/order-details";
-@import "components/category-page";
\ No newline at end of file
+@import "components/category-page";
+@import "components/search";
\ No newline at end of file
diff --git a/templates/search/results.html b/templates/search/results.html
index db94f32cbd..b12318933e 100644
--- a/templates/search/results.html
+++ b/templates/search/results.html
@@ -20,7 +20,7 @@
{% endblock breadcrumb %}
{% block content %}
- <div class="row home__featured">
+ <div class="row home__featured search_results">
<div class="col-sm-12">
{% if query and results %}
<div class="row">
@@ -28,11 +28,12 @@
</div>
{% bootstrap_pagination results url=query_string %}
{% else %}
- <div class="row">
- <div class="">
- <h2>Search: {{ query }}</h2>
+ <div class="row no-results">
+ <div class="col-12">
+ <h2>Search: <strong>{{ query }}</strong></h2>
<img src="{% static 'img/pirate.svg' %}" />
- <p>{% trans "Sorry, no matches found for your request. Try again or shop new arrivals" %}</p>
+ <p>{% trans "Sorry, no matches found for your request." %}</p>
+ <p>{% trans "Try again or shop new arrivals." %}</p>
</div>
</div>
{% endif %}