Skip to content

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

Add style guide base, make links on page more consistent

weronkab66c823cf95b
diff --git a/saleor/core/urls.py b/saleor/core/urls.py
index 84a7719a03..16cbf75b6d 100644
--- a/saleor/core/urls.py
+++ b/saleor/core/urls.py
@@ -4,5 +4,6 @@ from . import views
urlpatterns = [
- url(r'^$', views.home, name='home')
+ url(r'^$', views.home, name='home'),
+ url(r'^style-guide/', views.styleguide, name='styleguide'),
]
diff --git a/saleor/core/views.py b/saleor/core/views.py
index ea94641095..94021741f1 100644
--- a/saleor/core/views.py
+++ b/saleor/core/views.py
@@ -10,3 +10,6 @@ def home(request):
return TemplateResponse(
request, 'home.html',
{'products': products, 'parent': None})
+
+def styleguide(request):
+ return TemplateResponse(request, 'styleguide.html')
diff --git a/saleor/static/scss/storefront/components/_cart-dropdown.scss b/saleor/static/scss/storefront/components/_cart-dropdown.scss
index 92a1674236..f49d1d7df8 100644
--- a/saleor/static/scss/storefront/components/_cart-dropdown.scss
+++ b/saleor/static/scss/storefront/components/_cart-dropdown.scss
@@ -60,12 +60,6 @@
}
}
}
- a {
- color: $body-color;
- &:hover {
- text-decoration: none;
- }
- }
&__image {
float: left;
width: 60px;
diff --git a/saleor/static/scss/storefront/components/_header.scss b/saleor/static/scss/storefront/components/_header.scss
index 033cb318a1..6dae1ce16b 100644
--- a/saleor/static/scss/storefront/components/_header.scss
+++ b/saleor/static/scss/storefront/components/_header.scss
@@ -261,5 +261,3 @@
}
}
}
-
-
diff --git a/saleor/static/scss/storefront/components/_fonts.scss b/saleor/static/scss/storefront/components/_typography.scss
similarity index 67%
rename from saleor/static/scss/storefront/components/_fonts.scss
rename to saleor/static/scss/storefront/components/_typography.scss
index 94c238ab52..d693190aa3 100644
--- a/saleor/static/scss/storefront/components/_fonts.scss
+++ b/saleor/static/scss/storefront/components/_typography.scss
@@ -19,3 +19,27 @@
url('../../fonts/Lato-Bold.ttf') format('truetype');
font-weight: 700;
}
+
+h3 {
+ text-transform: uppercase;
+}
+
+a {
+ color: $blue;
+ text-decoration: none;
+ &:hover {
+ text-decoration: underline;
+ }
+ &.link--styled {
+ font-size: 0.8rem;
+ color: $body-color;
+ text-decoration: underline;
+ display: block;
+ }
+ &.link--clean {
+ color: $body-color;
+ &:hover {
+ text-decoration: none;
+ }
+ }
+}
\ No newline at end of file
diff --git a/saleor/static/scss/storefront/components/table.scss b/saleor/static/scss/storefront/components/table.scss
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/saleor/static/scss/storefront/components/_cart.scss b/saleor/static/scss/storefront/layouts/_cart.scss
similarity index 97%
rename from saleor/static/scss/storefront/components/_cart.scss
rename to saleor/static/scss/storefront/layouts/_cart.scss
index 4cbc1659e2..491aae36db 100644
--- a/saleor/static/scss/storefront/components/_cart.scss
+++ b/saleor/static/scss/storefront/layouts/_cart.scss
@@ -25,9 +25,7 @@
&__product {
a {
transition: 0.3s;
- color: $body-color;
&:hover {
- text-decoration: none;
color: $skull-gray;
}
p {
diff --git a/saleor/static/scss/storefront/components/_category-page.scss b/saleor/static/scss/storefront/layouts/_category-page.scss
similarity index 100%
rename from saleor/static/scss/storefront/components/_category-page.scss
rename to saleor/static/scss/storefront/layouts/_category-page.scss
diff --git a/saleor/static/scss/storefront/components/_checkout.scss b/saleor/static/scss/storefront/layouts/_checkout.scss
similarity index 95%
rename from saleor/static/scss/storefront/components/_checkout.scss
rename to saleor/static/scss/storefront/layouts/_checkout.scss
index 8643586fcc..37982299f5 100644
--- a/saleor/static/scss/storefront/components/_checkout.scss
+++ b/saleor/static/scss/storefront/layouts/_checkout.scss
@@ -12,9 +12,6 @@
}
&__edit-link {
margin-top: $global-margin;
- a {
- color: $blue;
- }
}
&__header {
background-color: $light-gray;
@@ -79,11 +76,6 @@
margin-bottom: 0;
}
}
- a {
- color: $body-color;
- text-decoration: underline;
- font-size: 0.8rem;
- }
}
}
&__review {
@@ -140,9 +132,6 @@
h1 {
font-weight: 300;
margin-top: -$global-margin * 4;
- a {
- color: $blue;
- }
}
&__form {
margin-top: $global-margin * 6;
diff --git a/saleor/static/scss/storefront/components/_home.scss b/saleor/static/scss/storefront/layouts/_home.scss
similarity index 100%
rename from saleor/static/scss/storefront/components/_home.scss
rename to saleor/static/scss/storefront/layouts/_home.scss
diff --git a/saleor/static/scss/storefront/components/_login.scss b/saleor/static/scss/storefront/layouts/_login.scss
similarity index 100%
rename from saleor/static/scss/storefront/components/_login.scss
rename to saleor/static/scss/storefront/layouts/_login.scss
diff --git a/saleor/static/scss/storefront/components/_no-results.scss b/saleor/static/scss/storefront/layouts/_no-results.scss
similarity index 100%
rename from saleor/static/scss/storefront/components/_no-results.scss
rename to saleor/static/scss/storefront/layouts/_no-results.scss
diff --git a/saleor/static/scss/storefront/components/_order-details.scss b/saleor/static/scss/storefront/layouts/_order-details.scss
similarity index 100%
rename from saleor/static/scss/storefront/components/_order-details.scss
rename to saleor/static/scss/storefront/layouts/_order-details.scss
diff --git a/saleor/static/scss/storefront/components/_product-list.scss b/saleor/static/scss/storefront/layouts/_product-list.scss
similarity index 100%
rename from saleor/static/scss/storefront/components/_product-list.scss
rename to saleor/static/scss/storefront/layouts/_product-list.scss
diff --git a/saleor/static/scss/storefront/components/_product-page.scss b/saleor/static/scss/storefront/layouts/_product-page.scss
similarity index 100%
rename from saleor/static/scss/storefront/components/_product-page.scss
rename to saleor/static/scss/storefront/layouts/_product-page.scss
diff --git a/saleor/static/scss/storefront/layouts/_styleguide.scss b/saleor/static/scss/storefront/layouts/_styleguide.scss
new file mode 100644
index 0000000000..f56c4285d3
--- /dev/null
+++ b/saleor/static/scss/storefront/layouts/_styleguide.scss
@@ -0,0 +1,23 @@
+.styleguide {
+ &__nav {
+ a {
+ display: block;
+ }
+ }
+ &__content {
+ &__block {
+ padding-bottom: $global-padding * 3;
+ border-bottom: 1px solid $skull-gray;
+ &__title {
+ padding-top: $global-padding;
+ margin-bottom: $global-margin * 2;
+ }
+ &__bold {
+ font-weight: 700;
+ }
+ &__light {
+ font-weight: 300;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/saleor/static/scss/storefront/components/_userprofile.scss b/saleor/static/scss/storefront/layouts/_userprofile.scss
similarity index 95%
rename from saleor/static/scss/storefront/components/_userprofile.scss
rename to saleor/static/scss/storefront/layouts/_userprofile.scss
index 604cc19596..d9277c328d 100644
--- a/saleor/static/scss/storefront/components/_userprofile.scss
+++ b/saleor/static/scss/storefront/layouts/_userprofile.scss
@@ -72,14 +72,6 @@
border-bottom: 1px solid $gray;
padding: $global-padding 0;
font-size: 0.9rem;
- a {
- color: $body-color;
- text-decoration: underline;
- padding-right: $global-padding / 2;
- &:hover {
- text-decoration: none;
- }
- }
}
&-header {
border-bottom: 1px solid $gray;
diff --git a/saleor/static/scss/storefront/storefront.scss b/saleor/static/scss/storefront/storefront.scss
index 894da09eda..e77db7c3a3 100644
--- a/saleor/static/scss/storefront/storefront.scss
+++ b/saleor/static/scss/storefront/storefront.scss
@@ -1,7 +1,7 @@
@import "variables";
@import "~bootstrap/scss/bootstrap";
-@import "components/fonts";
+@import "components/typography";
@import "components/buttons";
@import "components/labels";
@import "components/pagination";
@@ -10,14 +10,15 @@
@import "components/cart-dropdown";
@import "components/header";
@import "components/footer";
-@import "components/home";
-@import "components/product-page";
-@import "components/cart";
-@import "components/userprofile";
-@import "components/login";
-@import "components/product-list";
-@import "components/checkout";
-@import "components/order-details";
-@import "components/category-page";
-@import "components/no-results";
+@import "layouts/home";
+@import "layouts/product-page";
+@import "layouts/cart";
+@import "layouts/userprofile";
+@import "layouts/login";
+@import "layouts/product-list";
+@import "layouts/checkout";
+@import "layouts/order-details";
+@import "layouts/category-page";
+@import "layouts/no-results";
+@import "layouts/styleguide";
@import "components/loader";
diff --git a/saleor/static/scss/storefront/variables.scss b/saleor/static/scss/storefront/variables.scss
index ebf24dfaa9..a77233b333 100644
--- a/saleor/static/scss/storefront/variables.scss
+++ b/saleor/static/scss/storefront/variables.scss
@@ -19,6 +19,7 @@ $darkred: #c53636;
$green: #27AE60;
$darkgreen: #1b8a4a;
$blue: #26A5D4;
+
// TYPOGRAPHY
$font-family-sans-serif: 'Lato';
diff --git a/templates/account/partials/login_form.html b/templates/account/partials/login_form.html
index 1b2f271f8e..0e2850508f 100644
--- a/templates/account/partials/login_form.html
+++ b/templates/account/partials/login_form.html
@@ -15,7 +15,7 @@
<button class="btn primary">
{% trans "Log in" context "Login form primary action" %}
</button>
- <a href="{% url 'account_reset_password' %}">
+ <a class="link--styled" href="{% url 'account_reset_password' %}">
{% trans "Forgot password?" context "Login form secondary link" %}
</a>
</div>
diff --git a/templates/styleguide.html b/templates/styleguide.html
new file mode 100644
index 0000000000..894f626180
--- /dev/null
+++ b/templates/styleguide.html
@@ -0,0 +1,75 @@
+{% extends "base.html" %}
+{% load i18n %}
+{% load staticfiles %}
+
+{% block header %}
+ <div class="container navbar__login">
+ </div>
+ <header class="checkout__header">
+ <div class="container">
+ <a href="/">
+ <img src="{% static "images/saleor-logo-black.svg" %}"
+ alt="{% trans "Testeor - Saleor demo store" context "Checkout logo alternate text" %}"
+ height="38">
+ </a>
+ <h1>{% trans "Style guide" context "Style guide title" %}</h1>
+ </div>
+ </header>
+{% endblock %}
+
+{% block content %}
+<div class="container styleguide">
+ <div class="row">
+ <div class="col-md-3">
+ <nav class="styleguide__nav">
+ <a href="#identity">{% trans "Identity" context "Identity title in style guide" %}</a>
+ <a href="#typography">{% trans "Typography" context "Typography title in style guide" %}</a>
+ <a href="#colors">{% trans "Colors" context "Colors title in style guide" %}</a>
+ <a href="#grid">{% trans "Grid" context "Grid title in style guide" %}</a>
+ <a href="#icons">{% trans "Icons" context "Icons title in style guide" %}</a>
+ <a href="#buttons">{% trans "Buttons" context "Buttons title in style guide" %}</a>
+ <a href="#forms">{% trans "Forms" context "Forms title in style guide" %}</a>
+ <a href="#filters">{% trans "Filters" context "Filters title in style guide" %}</a>
+ <a href="#pagination">{% trans "Pagination" context "Pagination title in style guide" %}</a>
+ <a href="#breadcrumbs">{% trans "Breadcrumbs" context "Breadcrumbs title in style guide" %}</a>
+ <a href="#notifications">{% trans "Notifications" context "Notifications title in style guide" %}</a>
+ <a href="#mainnav">{% trans "Main navigation" context "Main navigation title in style guide" %}</a>
+ <a href="#tabs">{% trans "Tabs" context "Tabs title in style guide" %}</a>
+ <a href="#tables">{% trans "Tables" context "Tables title in style guide" %}</a>
+ <a href="#cards">{% trans "Cards" context "Cards title in style guide" %}</a>
+ </nav>
+ </div>
+ <div class="col-md-9 styleguide__content">
+ <div id="identity" class="styleguide__content__block">
+ <h3 class="styleguide__content__block__title">{% trans "Identity" context "Identity title in style guide" %}</h3>
+ <div class="row">
+ <div class="col-md-6">
+ <p>{% trans "Logo" %}</p>
+ <img src="{% static "images/saleor-logo-black.svg" %}" alt="Testeor - Saleor demo store" height="38">
+ </div>
+ <div class="col-md-6">
+ <p>{% trans "Favicon" %}</p>
+ <img src="{% static "images/favicons/ms-icon-150x150.png" %}" alt="Testeor - Saleor demo store" height="38">
+ </div>
+ </div>
+ </duiv>
+ </div>
+ <div id="typography" class="styleguide__content__block">
+ <h3 class="styleguide__content__block__title">{% trans "Typography" context "Typography title in style guide" %}</h3>
+ <p>We use Lato fontface in Regular(400), <span class="styleguide__content__block__light">Light(300)</span> and <span class="styleguide__content__block__bold">Bold(700)</span> weights.</p>
+ <h1>h1 / Header</h1>
+ <h2>h2 / Header</h2>
+ <h3>h3 / Header (always uppercased)</h3>
+ <p>p / Simple paragraph</p>
+ <a href="#">a / Simple link</a>
+ <a href="#" class="link--styled">a / Styled link</a>
+ </div>
+ </div>
+</div>
+{% endblock %}
+
+{% block footer %}
+{% endblock %}
+
+
+{% load i18n %}
\ No newline at end of file
diff --git a/templates/userprofile/details.html b/templates/userprofile/details.html
index 5a30b5ac03..d4739634fc 100644
--- a/templates/userprofile/details.html
+++ b/templates/userprofile/details.html
@@ -77,7 +77,7 @@
{% render_status order.status order.get_status_display %}
</div>
<div class="col-md-1 col-3">
- <a href="{{ order.get_absolute_url }}" class="float-right">
+ <a href="{{ order.get_absolute_url }}" class="float-right link--styled">
{% trans "Details" context "Recent orders link text" %}
</a>
</div>