Skip to content

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

Fix style guides styles

weronka17fe214d8803
diff --git a/saleor/static/dashboard/scss/components/_buttons.scss b/saleor/static/dashboard/scss/components/_buttons.scss
index a36172e61a..a7be77051c 100644
--- a/saleor/static/dashboard/scss/components/_buttons.scss
+++ b/saleor/static/dashboard/scss/components/_buttons.scss
@@ -2,7 +2,7 @@
color: $secondary-color;
}
-.btn-fab {
+.btn-fab, .btn-floating {
svg {
vertical-align: middle;
}
diff --git a/saleor/static/dashboard/scss/layouts/_style-guide.scss b/saleor/static/dashboard/scss/layouts/_style-guide.scss
index 786603d0ff..7e77db4224 100644
--- a/saleor/static/dashboard/scss/layouts/_style-guide.scss
+++ b/saleor/static/dashboard/scss/layouts/_style-guide.scss
@@ -24,6 +24,9 @@
&.fixed {
position: fixed !important;
top: 0;
+ @media only screen and (max-width: $small-screen-up) {
+ position: relative !important;
+ }
}
li {
padding: 5px 20px;
@@ -44,6 +47,14 @@
}
}
&__content {
+ h3, h4, p {
+ svg {
+ max-height: 14px;
+ max-width: 14px;
+ vertical-align: middle;
+ fill: currentColor;
+ }
+ }
&__block {
.container {
margin-left: 0;
@@ -104,6 +115,14 @@
border: solid 1px $grey-color;
}
}
+ &#icons {
+ svg {
+ max-height: 24px;
+ max-width: 24px;
+ fill: $off-black;
+ margin-top: 10px;
+ }
+ }
}
}
diff --git a/saleor/static/js/components/categoryPage/ProductPrice.js b/saleor/static/js/components/categoryPage/ProductPrice.js
index ff65a2c322..9cdfd6e5c9 100644
--- a/saleor/static/js/components/categoryPage/ProductPrice.js
+++ b/saleor/static/js/components/categoryPage/ProductPrice.js
@@ -13,7 +13,7 @@ const ProductPrice = ({ availability, price }) => {
{isPriceRange && <span>{gettext('from')} </span>} {priceRange.minPrice.grossLocalized}
</span>
{discount && (
- <div className="product-list__sale"><InlineSVG src={SaleImg} /><span>{gettext('Sale')}</span></div>
+ <div className="product-list__sale"><InlineSVG src={SaleImg} /><span className="product-list__sale__text">{gettext('Sale')}</span></div>
)}
</div>
);
diff --git a/saleor/static/scss/components/_forms.scss b/saleor/static/scss/components/_forms.scss
index 25b2ffc955..efd8d55610 100644
--- a/saleor/static/scss/components/_forms.scss
+++ b/saleor/static/scss/components/_forms.scss
@@ -148,6 +148,7 @@ input#id_quantity {
.passIcon {
max-width: 15px;
+ max-height: 15px;
position: absolute;
top: 2.8rem;
right: 0.5rem;
diff --git a/saleor/static/scss/layouts/_product-list.scss b/saleor/static/scss/layouts/_product-list.scss
index e649029980..038fb80a4c 100644
--- a/saleor/static/scss/layouts/_product-list.scss
+++ b/saleor/static/scss/layouts/_product-list.scss
@@ -18,7 +18,7 @@
left: 0;
top: 0;
}
- span {
+ &__text {
position: absolute;
top: 0.5rem;
left: 0.15rem;
diff --git a/saleor/static/scss/layouts/_styleguide.scss b/saleor/static/scss/layouts/_styleguide.scss
index b68c927c3a..5934c5013a 100644
--- a/saleor/static/scss/layouts/_styleguide.scss
+++ b/saleor/static/scss/layouts/_styleguide.scss
@@ -6,7 +6,10 @@
margin-bottom: $global-margin * 2;
&.fixed {
position: fixed;
- top: 20px;;
+ top: 20px;
+ @include media-breakpoint-down(sm) {
+ position: relative;
+ }
}
}
&__content {
@@ -14,6 +17,7 @@
svg {
fill: $body-color;
max-height: 14px;
+ max-width: 14px;
vertical-align: middle;
}
}
diff --git a/templates/category/_items.html b/templates/category/_items.html
index 9b9a2bc749..78b5da2fa1 100644
--- a/templates/category/_items.html
+++ b/templates/category/_items.html
@@ -26,10 +26,8 @@
{% if availability.discount %}
{% if availability.price_range_undiscounted.min_price != availability.price_range.min_price %}
<div class="product-list__sale">
- <span class="isvg">
- <svg data-src="{% static "images/sale_bg.svg" %}" />
- </span>
- <span>
+ <svg data-src="{% static "images/sale_bg.svg" %}" />
+ <span class="product-list__sale__text">
{% comment %}Translators: Layout may break if character length is different than four.{% endcomment %}
{% trans "Sale" context "Sale (discount) label for item in product list" %}
</span>
diff --git a/templates/dashboard/styleguide/index.html b/templates/dashboard/styleguide/index.html
index 153b5cec46..4dac776d10 100644
--- a/templates/dashboard/styleguide/index.html
+++ b/templates/dashboard/styleguide/index.html
@@ -444,12 +444,6 @@
</h3>
<div class="card">
<div class="card-content">
- <div class="section">
- <h4>
- Usage
- </h4>
- <code>&lt;i class=&quot;material-icons&quot;&gt;&lt;/i&gt;</code>
- </div>
<div class="section">
<h4>
Used icons
@@ -457,7 +451,7 @@
<svg data-src="{% static "dashboard/images/add.svg" %}" />
<svg data-src="{% static "dashboard/images/account_circle.svg" %}" />
<svg data-src="{% static "dashboard/images/search.svg" %}" />
- <svg data-src="{% static "dashboard/images/menu.svg" %}" />
+ <svg data-src="{% static "dashboard/images/mobile_menu.svg" %}" />
<svg data-src="{% static "dashboard/images/more_vert.svg" %}" height="24" width="24" />
<svg data-src="{% static "dashboard/images/arrow_left.svg" %}" />
<svg data-src="{% static "dashboard/images/chevron_right.svg" %}" fill="#000" />
@@ -1369,7 +1363,9 @@
<ul class="collection list">
<li class="collection-item avatar list-item">
<a href="#" contenteditable="true">
- <img src="{% static 'images/product-image-placeholder-small.png' %}" alt="" class="circle teal">
+ <img src="{% static 'images/placeholder60x60.png' %}"
+ srcset="{% static 'images/placeholder60x60.png' %} 1x, {% static 'images/placeholder120x120.png' %} 2x"
+ alt="" class="circle teal">
<span class="title list-item-name">
Miller-Hill
</span>
@@ -1380,7 +1376,9 @@
</li>
<li class="collection-item avatar list-item">
<a href="#" contenteditable="true">
- <img src="{% static 'images/product-image-placeholder-small.png' %}" alt="" class="circle teal">
+ <img src="{% static 'images/placeholder60x60.png' %}"
+ srcset="{% static 'images/placeholder60x60.png' %} 1x, {% static 'images/placeholder120x120.png' %} 2x"
+ alt="" class="circle teal">
<span class="title list-item-name">
Schmidt and Sons
</span>
@@ -1391,7 +1389,9 @@
</li>
<li class="collection-item avatar list-item">
<a href="#" contenteditable="true">
- <img src="{% static 'images/product-image-placeholder-small.png' %}" alt="" class="circle teal">
+ <img src="{% static 'images/placeholder60x60.png' %}"
+ srcset="{% static 'images/placeholder60x60.png' %} 1x, {% static 'images/placeholder120x120.png' %} 2x"
+ alt="" class="circle teal">
<span class="title list-item-name">
Ramirez PLC
</span>
@@ -1402,7 +1402,9 @@
</li>
<li class="collection-item avatar list-item">
<a href="#" contenteditable="true">
- <img src="{% static 'images/product-image-placeholder-small.png' %}" alt="" class="circle teal">
+ <img src="{% static 'images/placeholder60x60.png' %}"
+ srcset="{% static 'images/placeholder60x60.png' %} 1x, {% static 'images/placeholder120x120.png' %} 2x"
+ alt="" class="circle teal">
<span class="title list-item-name">
Foster-Brown
</span>
diff --git a/templates/styleguide.html b/templates/styleguide.html
index 80d721e040..5569f78d84 100644
--- a/templates/styleguide.html
+++ b/templates/styleguide.html
@@ -704,7 +704,7 @@
<div class="panel-footer">
<div class="product-list__sale">
<svg data-src="{% static "images/sale_bg.svg" %}" />
- <span contenteditable="true">Sale</span>
+ <span class="product-list__sale__text" contenteditable="true">Sale</span>
</div>
<span contenteditable="true">FROM $72.25</span>
</div>