Skip to content

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

Add buttons to style guide

weronkad1457726acb1
diff --git a/saleor/static/js/components/categoryPage/PriceFilter.js b/saleor/static/js/components/categoryPage/PriceFilter.js
index 7a1f5f68a5..047c456fe5 100644
--- a/saleor/static/js/components/categoryPage/PriceFilter.js
+++ b/saleor/static/js/components/categoryPage/PriceFilter.js
@@ -69,7 +69,7 @@ export default class PriceFilter extends Component {
ref={input => (this.maxPriceInput = input)}
type="number"
/>
- <button className="btn btn-primary" onClick={this.updateFilter}>{gettext('Update')}</button>
+ <button className="btn primary" onClick={this.updateFilter}>{gettext('Update')}</button>
</div>
)}
</div>
diff --git a/saleor/static/js/components/categoryPage/ProductList.js b/saleor/static/js/components/categoryPage/ProductList.js
index 081ce7335a..204a064133 100644
--- a/saleor/static/js/components/categoryPage/ProductList.js
+++ b/saleor/static/js/components/categoryPage/ProductList.js
@@ -26,7 +26,7 @@ class ProductList extends Component {
</div>
<div className="load-more">
{hasNextPage && (
- <button className="btn" onClick={this.onLoadMore}>{gettext('Load more')}</button>
+ <button className="btn gray" onClick={this.onLoadMore}>{gettext('Load more')}</button>
)}
</div>
</div>
diff --git a/saleor/static/scss/storefront/components/_buttons.scss b/saleor/static/scss/storefront/components/_buttons.scss
index 27d3bf2351..90451105e9 100644
--- a/saleor/static/scss/storefront/components/_buttons.scss
+++ b/saleor/static/scss/storefront/components/_buttons.scss
@@ -8,6 +8,7 @@ a.btn {
font-weight: 300;
font-size: 1rem;
cursor: pointer;
+ font-family: $font-family-sans-serif;
&.home__button {
text-transform: uppercase;
font-size: $font-size-h3;
@@ -27,7 +28,7 @@ a.btn {
border: none;
&:hover {
background-color: $darken-blue;
- }
+ }
}
&.secondary {
border: 1px solid $blue;
@@ -40,18 +41,26 @@ a.btn {
}
}
&.danger {
- background-color: $red;
- color: $white;
+ border: 1px solid $red;
+ background-color: transparent;
+ color: $red;
padding: $global-padding $global-padding * 4;
&:hover {
- background-color: $dark-red
+ background-color: $dark-red;
+ color: $white;
}
}
- &.checkout {
+ &.narrow {
+ padding: $global-padding / 2 $global-padding * 2.5;
+ }
+ &.gray {
background-color: $gray;
border: 0;
- padding: $global-padding / 2 $global-padding * 2;
- text-transform: none;
+ color: $white;
+ padding: $global-padding $global-padding * 4;
+ &:hover {
+ background-color: $darken-gray;
+ }
}
&.btn-link {
padding: 0;
diff --git a/saleor/static/scss/storefront/components/_cart-dropdown.scss b/saleor/static/scss/storefront/components/_cart-dropdown.scss
index dda217c8a9..867df3b079 100644
--- a/saleor/static/scss/storefront/components/_cart-dropdown.scss
+++ b/saleor/static/scss/storefront/components/_cart-dropdown.scss
@@ -68,12 +68,6 @@
}
&__actions {
margin-top: $global-margin * 2;
- .btn {
- width: 100%;
- padding: $global-padding / 2;
- text-transform: uppercase;
- font-size: 1rem;
- }
}
&__empty {
img {
diff --git a/saleor/static/scss/storefront/layouts/_category-page.scss b/saleor/static/scss/storefront/layouts/_category-page.scss
index 71392133a5..d07a513f66 100644
--- a/saleor/static/scss/storefront/layouts/_category-page.scss
+++ b/saleor/static/scss/storefront/layouts/_category-page.scss
@@ -244,17 +244,6 @@
.load-more {
clear: both;
- button {
- width: 20rem;
- margin: 0 auto;
- display: block;
- color: $white;
- font-size: 2rem;
- cursor: pointer;
- outline: 0;
- &:hover {
- background: $darken-gray;
- }
- }
+ text-align: center;
}
}
\ No newline at end of file
diff --git a/saleor/static/scss/storefront/layouts/_checkout.scss b/saleor/static/scss/storefront/layouts/_checkout.scss
index 9ae1761e72..df3d260d00 100644
--- a/saleor/static/scss/storefront/layouts/_checkout.scss
+++ b/saleor/static/scss/storefront/layouts/_checkout.scss
@@ -101,9 +101,7 @@
position: absolute;
top: 0;
right: 0;
- padding: $global-padding / 2 $global-padding * 2;
margin-top: 0;
- background-color: $white;
}
&-form {
margin-bottom: $global-margin;
diff --git a/saleor/static/scss/storefront/layouts/_login.scss b/saleor/static/scss/storefront/layouts/_login.scss
index 42fc7ff585..bb73bd9b29 100644
--- a/saleor/static/scss/storefront/layouts/_login.scss
+++ b/saleor/static/scss/storefront/layouts/_login.scss
@@ -12,19 +12,9 @@
text-transform: uppercase;
margin-bottom: $global-margin * 2;
}
- p, a {
- color: $gray;
- }
- a:not(.btn) {
- text-decoration: underline;
- }
.btn {
- padding: $global-padding / 2 $global-padding * 2.5;
- font-size: 1rem;
- text-transform: uppercase;
margin: auto;
margin-top: $global-margin;
- font-family: $font-family-sans-serif;
}
&__btn-group {
text-align: center;
@@ -84,12 +74,6 @@
}
}
.login__btn-group {
- .btn {
- padding: $global-padding / 2 $global-padding * 3;
- margin: auto;
- text-transform: uppercase;
- font-family: $font-family-sans-serif;
- }
img {
padding-top: $global-padding * 2;
}
diff --git a/saleor/static/scss/storefront/layouts/_styleguide.scss b/saleor/static/scss/storefront/layouts/_styleguide.scss
index c28b812567..f312ec1ade 100644
--- a/saleor/static/scss/storefront/layouts/_styleguide.scss
+++ b/saleor/static/scss/storefront/layouts/_styleguide.scss
@@ -71,6 +71,11 @@
padding: $global-padding 0;
}
}
+ &#buttons {
+ button {
+ margin: $global-margin / 2;
+ }
+ }
}
}
}
\ No newline at end of file
diff --git a/saleor/static/scss/storefront/layouts/_userprofile.scss b/saleor/static/scss/storefront/layouts/_userprofile.scss
index 4f010befed..d0dc5e257b 100644
--- a/saleor/static/scss/storefront/layouts/_userprofile.scss
+++ b/saleor/static/scss/storefront/layouts/_userprofile.scss
@@ -88,9 +88,6 @@
.btn {
margin-top: $global-margin;
float: right;
- padding: $global-padding / 2 $global-padding * 2;
- text-transform: uppercase;
- font-size: 1rem;
}
}
&__addresses {
diff --git a/templates/account/login.html b/templates/account/login.html
index 815e3b5079..a86c24d560 100644
--- a/templates/account/login.html
+++ b/templates/account/login.html
@@ -13,7 +13,7 @@
<h3>{% trans "Don't have an account yet?" context "Login form secondary title" %}</h3>
<img src="{% static 'images/pirate_login.png' %}"
srcset="{% static 'images/pirate_login.png' %} 1x, {% static 'images/pirate_login2x.png' %} 2x">
- <a href="{{ signup_url }}" class="btn secondary">
+ <a href="{{ signup_url }}" class="btn secondary narrow">
{% trans "Register" context "Login form secondary action" %}
</a>
</div>
diff --git a/templates/account/partials/login_form.html b/templates/account/partials/login_form.html
index 0e2850508f..98568afe00 100644
--- a/templates/account/partials/login_form.html
+++ b/templates/account/partials/login_form.html
@@ -12,7 +12,7 @@
</fieldset>
<div class="row login__btn-group">
<div class="col-sm-12">
- <button class="btn primary">
+ <button class="btn primary narrow">
{% trans "Log in" context "Login form primary action" %}
</button>
<a class="link--styled" href="{% url 'account_reset_password' %}">
diff --git a/templates/account/password_reset.html b/templates/account/password_reset.html
index d98d4c7830..baee113b11 100644
--- a/templates/account/password_reset.html
+++ b/templates/account/password_reset.html
@@ -23,7 +23,7 @@
</fieldset>
<div class="row login__btn-group">
<div class="col-sm-12">
- <button class="btn primary">
+ <button class="btn primary narrow">
{% trans "Continue" context "Password reset primary action" %}
</button>
<img src="{% static "images/pirate-reset.png" %}" />
diff --git a/templates/account/password_reset_from_key.html b/templates/account/password_reset_from_key.html
index 07a4d79392..730a676e45 100644
--- a/templates/account/password_reset_from_key.html
+++ b/templates/account/password_reset_from_key.html
@@ -27,7 +27,7 @@
</fieldset>
<div class="row login__btn-group">
<div class="col-sm-12">
- <button class="btn primary">
+ <button class="btn primary narrow">
{% trans "Continue" context "Password reset from key form primary action" %}
</button>
<img src="{% static "images/pirate-reset.png" %}" />
diff --git a/templates/account/password_set.html b/templates/account/password_set.html
index 5268229e9c..21f3387a43 100644
--- a/templates/account/password_set.html
+++ b/templates/account/password_set.html
@@ -17,7 +17,7 @@
<input type="hidden" name="next" value="{{ next }}" />
</fieldset>
<div class="form-group text-right">
- <button class="btn btn-primary">
+ <button class="btn primary">
{% trans "Continue" context "Password set form primary action" %}
</button>
</div>
diff --git a/templates/account/signup.html b/templates/account/signup.html
index 762022ada0..e859ed2e25 100644
--- a/templates/account/signup.html
+++ b/templates/account/signup.html
@@ -13,7 +13,7 @@
<h3>{% trans "Already have an account?" context "Signup form secondary title" %}</h3>
<img class="signup-img" src="{% static 'images/pirate_login.png' %}"
srcset="{% static 'images/pirate_login.png' %} 1x, {% static 'images/pirate_login2x.png' %} 2x">
- <p><a href="{% url 'account_login' %}" class="btn secondary">
+ <p><a href="{% url 'account_login' %}" class="btn secondary narrow">
{% trans "Log in" context "Signup form secondary action" %}
</a></p>
</div>
@@ -29,7 +29,7 @@
value="{{ redirect_field_value }}"/>
{% endif %}
</fieldset>
- <button type="submit" class="btn btn primary">
+ <button type="submit" class="btn primary narrow">
{% trans "Create an account" context "Signup form primary action" %}
</button>
</form>
diff --git a/templates/cart-dropdown.html b/templates/cart-dropdown.html
index 04fc06059e..9adcd073d8 100644
--- a/templates/cart-dropdown.html
+++ b/templates/cart-dropdown.html
@@ -42,10 +42,10 @@
</div>
<div class="row cart-dropdown__actions">
<div class="col-md-5 offset-md-1">
- <a href="{% url "cart:index" %}" class="btn secondary float-md-right">{% trans "Go to cart" context "Cart dropdown secondary action" %}</a>
+ <a href="{% url "cart:index" %}" class="btn secondary narrow float-md-right">{% trans "Go to cart" context "Cart dropdown secondary action" %}</a>
</div>
<div class="col-md-5">
- <a href="{% url "checkout:login" %}" class="btn primary">{% trans "Checkout" context "Cart dropdown primary action" %}</a>
+ <a href="{% url "checkout:login" %}" class="btn primary narrow">{% trans "Checkout" context "Cart dropdown primary action" %}</a>
</div>
</div>
{% else %}
diff --git a/templates/checkout/snippets/voucher-form.html b/templates/checkout/snippets/voucher-form.html
index 7680a01caf..d65b620b60 100644
--- a/templates/checkout/snippets/voucher-form.html
+++ b/templates/checkout/snippets/voucher-form.html
@@ -26,7 +26,7 @@
{% csrf_token %}
<div class="form-group checkout__review__voucher">
{% trans "Use" context "Checkout voucher form action" as use_voucher %}
- {% bootstrap_field form.voucher show_label=False %} {% bootstrap_button use_voucher button_type="submit" button_class="btn secondary" %}
+ {% bootstrap_field form.voucher show_label=False %} {% bootstrap_button use_voucher button_type="submit" button_class="btn secondary narrow" %}
</div>
</form>
{% endif %}
diff --git a/templates/order/payment/paypal-card.html b/templates/order/payment/paypal-card.html
index ee3b48b2e7..2d7baf5550 100644
--- a/templates/order/payment/paypal-card.html
+++ b/templates/order/payment/paypal-card.html
@@ -10,7 +10,7 @@
{% bootstrap_form form layout="horizontal" %}
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
- <button type="submit" class="btn btn-primary">
+ <button type="submit" class="btn primary">
{% trans "Save changes" context "Payment form (PayPal) primary action" %}
</button>
</div>
diff --git a/templates/styleguide.html b/templates/styleguide.html
index 55f4c6c28b..37dd9b1473 100644
--- a/templates/styleguide.html
+++ b/templates/styleguide.html
@@ -133,7 +133,7 @@
</div>
</div>
</div>
- <div id="tgrid" class="styleguide__content__block">
+ <div id="grid" class="styleguide__content__block">
<h3 class="styleguide__content__block__title">{% trans "Grid" context "Grid title in style guide" %}</h3>
<p>We use <a href="https://v4-alpha.getbootstrap.com/getting-started/introduction/">Bootstrap 4</a> responsive grid which is based on a 12 column layout. In most cases we use following combinations:</p>
<div class="row styleguide__content__block__grid">
@@ -172,6 +172,41 @@
</div>
</div>
</div>
+ <div id="buttons" class="styleguide__content__block">
+ <h3 class="styleguide__content__block__title">{% trans "Buttons" context "Buttons title in style guide" %}</h3>
+ <div class="row">
+ <div class="container">
+ <button class="btn primary">
+ {% trans "Primary" context "Primary button example in styleguide" %}
+ </button>
+ <button class="btn secondary">
+ {% trans "Secondary" context "Secondary button example in styleguide" %}
+ </button>
+ <button class="btn danger">
+ {% trans "Danger" context "Danger button example in styleguide" %}
+ </button>
+ <button class="btn gray">
+ {% trans "Gray" context "Gray button example in styleguide" %}
+ </button>
+ </div>
+
+ </div>
+ <div class="row">
+ <div class="container">
+ <button class="btn primary narrow">
+ {% trans "Primary narrow" context "Primary narrow button example in styleguide" %}
+ </button>
+ <button class="btn secondary narrow">
+ {% trans "Secondary narrow" context "Secondary narow button example in styleguide" %}
+ </button>
+ <button class="btn danger narrow">
+ {% trans "Danger narrow" context "Danger narow button example in styleguide" %}
+ </button>
+ </div>
+
+ </div>
+ </duiv>
+ </div>
</div>
</div>
{% endblock %}
diff --git a/templates/userprofile/address-delete.html b/templates/userprofile/address-delete.html
index 6ed3c046c4..ab82de8a02 100644
--- a/templates/userprofile/address-delete.html
+++ b/templates/userprofile/address-delete.html
@@ -2,7 +2,7 @@
<div class="address-delete none">
<form method="post" novalidate action="{% url 'profile:address-delete' pk=address.pk %}">
{% csrf_token %}
- <button type="submit" class="btn btn-outline-danger float-right">
+ <button type="submit" class="btn danger narrow float-right">
{% trans "Delete Address" context "Delete address form action" %}
</button>
<a class="btn btn-link cancel float-right">
diff --git a/templates/userprofile/address-edit.html b/templates/userprofile/address-edit.html
index 0d18c0503a..478222509b 100644
--- a/templates/userprofile/address-edit.html
+++ b/templates/userprofile/address-edit.html
@@ -45,7 +45,7 @@
{% include "userprofile/snippets/address-form.html" %}
</div>
<p class="text-right">
- <button type="submit" class="btn primary">
+ <button type="submit" class="btn primary narrow">
{% trans "Save changes" context "Edit/new address primary action" %}
</button>
</p>
diff --git a/templates/userprofile/details.html b/templates/userprofile/details.html
index d4739634fc..f09b940317 100644
--- a/templates/userprofile/details.html
+++ b/templates/userprofile/details.html
@@ -98,7 +98,7 @@
<form action="" method="post">
{% csrf_token %}
{% bootstrap_form change_password_form %}
- <input type="submit" class="btn primary"
+ <input type="submit" class="btn primary narrow"
value="{% trans "Change password" context "User profile action" %}">
</form>
</div>