Skip to content

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

Add styles to social buttons

Krzysztof Białogłowicz88f7c620f13e
diff --git a/saleor/static/images/facebook_icon.svg b/saleor/static/images/facebook_icon.svg
new file mode 100644
index 0000000000..45c2ee19fb
--- /dev/null
+++ b/saleor/static/images/facebook_icon.svg
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 155.139 155.139" style="enable-background:new 0 0 155.139 155.139;" xml:space="preserve" width="512px" height="512px">
+<g>
+ <path id="f_1_" d="M89.584,155.139V84.378h23.742l3.562-27.585H89.584V39.184 c0-7.984,2.208-13.425,13.67-13.425l14.595-0.006V1.08C115.325,0.752,106.661,0,96.577,0C75.52,0,61.104,12.853,61.104,36.452 v20.341H37.29v27.585h23.814v70.761H89.584z" fill="#ffffff"/>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+</svg>
diff --git a/saleor/static/images/google_icon.svg b/saleor/static/images/google_icon.svg
new file mode 100644
index 0000000000..8004027711
--- /dev/null
+++ b/saleor/static/images/google_icon.svg
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 491.858 491.858" style="enable-background:new 0 0 491.858 491.858;" xml:space="preserve" width="512px" height="512px">
+<g>
+ <g>
+ <g>
+ <path d="M377.472,224.957H201.319v58.718H308.79c-16.032,51.048-63.714,88.077-120.055,88.077 c-69.492,0-125.823-56.335-125.823-125.824c0-69.492,56.333-125.823,125.823-125.823c34.994,0,66.645,14.289,89.452,37.346 l42.622-46.328c-34.04-33.355-80.65-53.929-132.074-53.929C84.5,57.193,0,141.693,0,245.928s84.5,188.737,188.736,188.737 c91.307,0,171.248-64.844,188.737-150.989v-58.718L377.472,224.957L377.472,224.957z" fill="#FFFFFF"/>
+ <polygon points="491.858,224.857 455.827,224.857 455.827,188.826 424.941,188.826 424.941,224.857 388.91,224.857 388.91,255.74 424.941,255.74 424.941,291.772 455.827,291.772 455.827,255.74 491.858,255.74 " fill="#FFFFFF"/>
+ </g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+</svg>
diff --git a/saleor/static/scss/storefront/layouts/_login.scss b/saleor/static/scss/storefront/layouts/_login.scss
index 001ee11501..fc6892d761 100644
--- a/saleor/static/scss/storefront/layouts/_login.scss
+++ b/saleor/static/scss/storefront/layouts/_login.scss
@@ -17,10 +17,6 @@
}
&__btn-group {
text-align: center;
- img {
- display: block;
- margin: 0 auto;
- }
}
&__register {
padding: $global-padding * 2;
@@ -36,6 +32,37 @@
}
}
}
+ a.social-btn {
+ border-radius: $button-border-radius;
+ text-align: left;
+ padding: $global-padding / 2 0;
+ color: $white;
+ text-decoration: none;
+ text-transform: uppercase;
+ @include transition(background, 0.2s)
+ &:hover {
+ text-decoration: none;
+ }
+ img {
+ padding: 0 $global-padding / 2;
+ margin-right: $global-margin;
+ display: inline-block;
+ height: 20px;
+ border-right: solid 1px $light-gray;
+ }
+ &.facebook {
+ background: #3b5998;
+ &:hover {
+ background: darken(#3b5998, 10%)
+ }
+ }
+ &.google {
+ background: #dd4b39;
+ &:hover {
+ background: darken(#dd4b39, 10%)
+ }
+ }
+ }
&__form {
background: $light-gray;
padding: $global-padding * 2 $global-padding * 5;
diff --git a/templates/account/partials/login_form.html b/templates/account/partials/login_form.html
index d4e6f7f4dc..575928b843 100644
--- a/templates/account/partials/login_form.html
+++ b/templates/account/partials/login_form.html
@@ -1,5 +1,6 @@
{% load bootstrap_form from bootstrap3 %}
{% load i18n %}
+{% load staticfiles %}
<form method="post" action="{% url 'account_login' %}" novalidate>
{% csrf_token %}
@@ -18,12 +19,19 @@
<a class="link--styled" href="{% url 'account_reset_password' %}">
{% trans "Forgot password?" context "Login form secondary link" %}
</a>
- {% if 'facebook' in backends.backends %}
- <a href="{% url 'social:begin' 'facebook' %}">{% trans 'Facebook' %}</a>
- {% endif %}
- {% if 'google-oauth2' in backends.backends %}
- <a href="{% url 'social:begin' 'google-oauth2' %}">{% trans 'Google' %}</a>
- {% endif %}
+ <hr>
+ <div class="row">
+ <div class="col-sm-6">
+ {% if 'facebook' in backends.backends %}
+ <a class="social-btn facebook" href="{% url 'social:begin' 'facebook' %}"><img src="{% static 'images/facebook_icon.svg' %}" />{% trans 'Facebook' %}</a>
+ {% endif %}
+ </div>
+ <div class="col-sm-6">
+ {% if 'google-oauth2' in backends.backends %}
+ <a class="social-btn google" href="{% url 'social:begin' 'google-oauth2' %}"><img src="{% static 'images/google_icon.svg' %}" />{% trans 'Google' %}</a>
+ {% endif %}
+ </div>
+ </div>
</div>
</div>
</form>