Skip to content

Commit 8b61024

Browse files
authored
Merge pull request #179 from BeAPI/issue/add-default-login-page-styles
feat (login) : add login pages styles enqueued by wp login page mu-pl…
2 parents 2649600 + 1432fd2 commit 8b61024

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed

config/entries.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
22
app: ['./src/js/index.js', './src/scss/style.scss'],
33
editor: ['./src/js/editor.js', './src/scss/editor.scss'],
4+
login: './src/scss/login.scss',
45
}

src/img/static/logo.jpg

6.58 KB
Loading

src/scss/login.scss

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
// SCSS variables to customise the login page styles
2+
// The CSS file generated in dist/ by webpack is called automatically thanks to the WP Login Page mu-plugin present in the WP Skeleton.
3+
4+
$login-logo-path: "../../src/img/static/logo.jpg";
5+
$login-logo-size: 312px 43px;
6+
$login-logo-height: 60px;
7+
$login-body-bg-color: #666;
8+
$login-text-color: #fff;
9+
$login-link-color: #fff;
10+
$login-link-hover-color: #eee;
11+
$login-remember-input-check-color: #222;
12+
$login-btn-bg-color: #666;
13+
$login-btn-hover-bg-color: #222;
14+
15+
// Except for specific needs, it is not necessary to modify the SCSS rules below (modification of the SCSS variables is sufficient)
16+
17+
html,
18+
body {
19+
&::before,
20+
&::after {
21+
display: none;
22+
}
23+
}
24+
25+
body.login {
26+
// screen background color
27+
background: $login-body-bg-color;
28+
29+
// logo (before login form) path and size
30+
h1 a {
31+
display: block;
32+
width: 100%;
33+
height: $login-logo-height;
34+
background-image: url(#{$login-logo-path});
35+
background-repeat: no-repeat;
36+
background-position: center center;
37+
background-size: $login-logo-size;
38+
}
39+
40+
// default link styles
41+
a {
42+
color: $login-link-color;
43+
text-decoration: none;
44+
45+
&:hover,
46+
&:focus {
47+
color: $login-link-hover-color;
48+
text-decoration: underline;
49+
}
50+
}
51+
52+
// notice block border-left color
53+
.message,
54+
.success,
55+
#login_error {
56+
border-left-color: $login-text-color;
57+
}
58+
59+
// remember input checkbox check color
60+
input[type="checkbox"]:checked::before {
61+
color: $login-remember-input-check-color;
62+
}
63+
64+
// link after login form styles
65+
#nav,
66+
#backtoblog {
67+
a {
68+
color: $login-link-color;
69+
70+
&:focus,
71+
&:hover {
72+
color: $login-link-hover-color;
73+
text-decoration: underline;
74+
}
75+
}
76+
}
77+
}
78+
79+
// submit login form button styles
80+
.wp-core-ui {
81+
.button-primary {
82+
text-shadow: none;
83+
background-color: $login-btn-bg-color;
84+
border: 0;
85+
box-shadow: none;
86+
transition: all .2s ease;
87+
88+
&:hover {
89+
background-color: $login-btn-hover-bg-color;
90+
}
91+
}
92+
}

0 commit comments

Comments
 (0)