Skip to content

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

Add helper classes to storefront style guide

weronka81bb09aef954
diff --git a/saleor/static/scss/storefront/layouts/_styleguide.scss b/saleor/static/scss/storefront/layouts/_styleguide.scss
index 85052943aa..c8456db605 100644
--- a/saleor/static/scss/storefront/layouts/_styleguide.scss
+++ b/saleor/static/scss/storefront/layouts/_styleguide.scss
@@ -89,6 +89,11 @@
padding: $global-padding 0;
}
}
+ &#helpers {
+ div {
+ margin-bottom: $global-margin * 2;
+ }
+ }
&#icons {
img {
max-width: 35px;
diff --git a/templates/styleguide.html b/templates/styleguide.html
index 94f66323d6..161957a28b 100644
--- a/templates/styleguide.html
+++ b/templates/styleguide.html
@@ -29,6 +29,7 @@
<a href="#colors">Colors</a>
<a href="#grid">Grid</a>
<a href="#responsive">Responsive breakpoints</a>
+ <a href="#helpers">Helper classes</a>
<a href="#icons">Icons</a>
<a href="#s">Buttons</a>
<a href="#forms">Forms</a>
@@ -56,7 +57,7 @@
<h1 contenteditable="true">h1 / Header</h1>
<h2 contenteditable="true">h2 / Header</h2>
<h3 contenteditable="true">h3 / Header (always uppercased)</h3>
- <p contenteditable="true">p / Saleor is open and free to use. It is not a bait to force you to pay us later and we promise to do our bests to fix bugs and improve the code. Some situations however call for a custom solution and extra code to be written. Whether you need us to cover an edsfxotic use case or build you a custom e-commerce appliance, our team can help.</p>
+ <p contenteditable="true">p / Saleor is open and free to use. It is not a bait to force you to pay us later and we promise to do our bests to fix bugs and improve the code. Some situations however call for a custom solution and extra code to be written. Whether you need us to cover an exotic use case or build you a custom e-commerce appliance, our team can help.</p>
<a href="#" contenteditable="true">a / Simple link</a>
<a href="#" class="link--styled" contenteditable="true">a / Styled link</a>
</div>
@@ -248,6 +249,45 @@
</div>
</div>
</div>
+ <div id="helpers" class="styleguide__content__block">
+ <h3 class="styleguide__content__block__title">Helper classes</h3>
+ <p>Storefront templates built with <a href="https://v4-alpha.getbootstrap.com/getting-started/introduction/">Bootstrap 4</a> framework wich has handful utility classes</p>
+ <p><strong>Responsive floats</strong></p>
+ <div>
+ <p class="float-left">
+ <code>&lt;div class="float-left"&gt;</code>Float left on all viewport sizes<code>&lt;/div&gt;</code>
+ </p>
+ </div>
+ <br>
+ <div>
+ <p class="float-right">
+ <code>&lt;div class="float-right"&gt;</code>Float right on all viewport sizes<code>&lt;/div&gt;</code>
+ </p>
+ </div>
+ <br>
+ <div>
+ <p class="float-none">
+ <code>&lt;div class="float-none"&gt;</code>Don't float on all viewport sizes<code>&lt;/div&gt;</code>
+ </p>
+ </div>
+ <br>
+ <div>
+ <p class="float-sm-left">
+ <code>&lt;div class="float-sm-left"&gt;</code>Float left on viewports sized SM (small) or wider<code>&lt;/div&gt;</code>
+ </p>
+ </div>
+ <br>
+ <div>
+ <p class="float-md-right">
+ <code>&lt;div class="float-md-right"&gt;</code>Float right on viewports sized MD (medium) or wider<code>&lt;/div&gt;</code>
+ </p>
+ </div>
+ <br>
+ <hr>
+ <p><strong>Responsive utilities</strong></p>
+ <p>The <code>.hidden-*-up</code> classes hide the element when the viewport is at the given breakpoint or wider. For example, <code>.hidden-md-up</code> hides an element on medium, large, and extra-large viewports.</p>
+ <p>The <code>.hidden-*-down</code> classes hide the element when the viewport is at the given breakpoint or smaller. For example, <code>.hidden-md-down</code> hides an element on extra-small, small, and medium viewports.</p>
+ </div>
<div id="icons" class="styleguide__content__block">
<h3 class="styleguide__content__block__title">Icons</h3>
<img src="{% static "images/cart.svg" %}">
@@ -640,7 +680,7 @@
<div class="text-center">
<div>
<img class="img-responsive" src="{% static "images/sample-product.jpg" %}" alt="">
- <span class="product-list-item-name">Johnson-Brown</span>
+ <span class="product-list-item-name" contenteditable="true">Johnson-Brown</span>
</div>
<div class="panel-footer">
<span contenteditable="true">$32.13</span>