Skip to content

Commit 15d95ae

Browse files
authored
Use CSS variables for some common colors (#689)
Aside from being able to tell what color it is or what purpose it solves just by looking at the variable name, it helps provide a foundation for more easily changing the theme in the future. Hopefully, we'll have a light and dark theme one day.
1 parent abbe050 commit 15d95ae

File tree

4 files changed

+78
-75
lines changed

4 files changed

+78
-75
lines changed

styles/home.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
}
5555

5656
.hero-btn-primary {
57-
background-color: #4f5b93;
57+
background-color: var(--dark-blue-color);
5858
color: #fff !important;
5959
}
6060

6161
.hero-btn-primary:hover, .hero-btn-primary:focus {
62-
background-color: #793862;
62+
background-color: var(--dark-magenta-color);
6363
}
6464

6565
.hero-btn-secondary {
@@ -69,8 +69,8 @@
6969
}
7070

7171
.hero-btn-secondary:hover, .hero-btn-secondary:focus {
72-
background-color: #793862;
73-
border-color: #793862;
72+
background-color: var(--dark-magenta-color);
73+
border-color: var(--dark-magenta-color);
7474
color: #fff !important;
7575
}
7676

@@ -94,7 +94,7 @@
9494
}
9595

9696
.hero-versions a {
97-
color:#ccc;
97+
color: var(--background-text-color);
9898
border:0;
9999
}
100100

styles/php8.css

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616

1717
.php8-section_dark {
18-
background-color: #4F5B93;
18+
background-color: var(--dark-blue-color);
1919
color: #fff;
2020
}
2121

@@ -102,7 +102,6 @@
102102
font-style: normal;
103103
line-height: 1.29;
104104
letter-spacing: -0.5px;
105-
color: #27282c;
106105
overflow: visible;
107106
}
108107

@@ -129,7 +128,7 @@
129128
padding: 16px 46px;
130129
border-radius: 30px;
131130
border: none;
132-
background-color: #4F5B93;
131+
background-color: var(--dark-blue-color);
133132
color: #fff !important;
134133
text-decoration: none !important;
135134
font-size: 20px;
@@ -210,7 +209,7 @@
210209
font-weight: normal;
211210
line-height: 1.6;
212211
vertical-align: middle;
213-
color: #505c90;
212+
color: var(--dark-blue-color);
214213
border-bottom-color: currentColor;
215214
}
216215

@@ -256,12 +255,12 @@
256255
line-height: 1.33;
257256
letter-spacing: normal;
258257
text-align: center;
259-
color: rgba(39, 40, 44, 0.7);
260-
background-color: rgba(39, 40, 44, 0.05);
258+
color: var(--background-color);
259+
background-color: var(--foreground-color);
261260
}
262261

263262
.php8-compare__label_new {
264-
background-color: #505c90;
263+
background-color: var(--dark-blue-color);
265264
color: #fff;
266265
}
267266

@@ -435,4 +434,4 @@
435434
padding: 4px 5px;
436435
color: rgba(39, 40, 44, 0.7);
437436
line-height: 1.33;
438-
}
437+
}

styles/theme-base.css

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
* Designed and built with all the love in the world @twitter by @mdo and @fat.
1010
*/
1111

12+
:root {
13+
--dark-grey-color: #333;
14+
--dark-blue-color: #4F5B93;
15+
--medium-blue-color: #7A86B8;
16+
--light-blue-color: #E2E4EF;
17+
--dark-magenta-color: #793862;
18+
--medium-magenta-color: #AE508D;
19+
}
20+
1221
.clearfix {
1322
*zoom: 1;
1423
}
@@ -60,7 +69,7 @@ a {
6069
border-bottom:1px solid;
6170
}
6271
a:focus {
63-
outline: thin dotted #333;
72+
outline: thin dotted var(--dark-grey-color);
6473
outline-offset: -2px;
6574
}
6675
a:hover,
@@ -865,7 +874,7 @@ table.standard th.subr {
865874

866875
#layout .cse .gsc-result-info,
867876
#layout .gsc-result-info {
868-
color: #333;
877+
color: var(--dark-grey-color);
869878
font-size: 0.75rem;
870879
padding: 0;
871880
margin: 0;
@@ -1006,20 +1015,20 @@ fieldset {
10061015
}
10071016

10081017
.tt-dropdown-menu {
1009-
background: none repeat scroll 0 0 #E2E4EF;
1018+
background: none repeat scroll 0 0 var(--light-blue-color);
10101019
border-bottom: 1px solid #C4C9DF;
10111020
border-radius: 0 0 2px 2px;
1012-
box-shadow: 1px 0 1px -1px #C4C9DF inset, -1px 0 1px -1px #C4C9DF inset, 0 0 1px #4F5B93;
1013-
color: #333333;
1021+
box-shadow: 1px 0 1px -1px #C4C9DF inset, -1px 0 1px -1px #C4C9DF inset, 0 0 1px var(--dark-blue-color);
1022+
color: var(--dark-grey-color);
10141023
padding-top: 3px;
10151024
margin-top: -3px;
10161025
min-width: 100%;
10171026
}
10181027

10191028
.tt-dropdown-menu .result-heading {
10201029
font-size:1.1rem;
1021-
border-bottom: 2px solid #4F5B93;
1022-
color: #E2E4EF;
1030+
border-bottom: 2px solid var(--dark-blue-color);
1031+
color: var(--light-blue-color);
10231032
text-shadow:0 -1px 0 rgba(0,0,0,.25);
10241033
word-spacing:6px;
10251034
margin: 0;
@@ -1078,7 +1087,7 @@ fieldset {
10781087
}
10791088

10801089
.tt-suggestion h4 {
1081-
color: #333;
1090+
color: var(--dark-grey-color);
10821091
margin: 0;
10831092
overflow: hidden;
10841093
text-overflow: ellipsis;
@@ -1099,7 +1108,7 @@ fieldset {
10991108

11001109
/* Selected items. */
11011110
.tt-suggestion.tt-is-under-cursor {
1102-
background-color: #4F5B93;
1111+
background-color: var(--dark-blue-color);
11031112
}
11041113

11051114
.tt-suggestion.tt-is-under-cursor h4 {
@@ -1619,7 +1628,7 @@ div.soft-deprecation-notice blockquote.sidebar {
16191628
}
16201629

16211630
#mainmenu-toggle-overlay {
1622-
background: #4F5B93 url(/images/mobile-menu.png) no-repeat center center;
1631+
background: var(--dark-blue-color) url(/images/mobile-menu.png) no-repeat center center;
16231632
float: right;
16241633
display: block;
16251634
height: 32px;
@@ -1722,7 +1731,7 @@ div.soft-deprecation-notice blockquote.sidebar {
17221731

17231732
#goto {
17241733
display: none;
1725-
background-color: #333;
1734+
background-color: var(--dark-grey-color);
17261735
height: 100%;
17271736
width: 100%;
17281737
opacity: 0.9;

0 commit comments

Comments
 (0)