Skip to content

Commit 26ae5c1

Browse files
authored
Eliminate hardcoded color values from the scss files (#35)
- tooltip and menu item colors are added to the base _variable.scss - using white and black predefined color names instead of hex values - updated midnight and aqua skins according to the latest common changes Signed-off-by: Hofi <hofione@gmail.com>
2 parents 030f57e + 2966f3b commit 26ae5c1

File tree

11 files changed

+104
-83
lines changed

11 files changed

+104
-83
lines changed

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
remote_theme: mmistakes/minimal-mistakes@4.24.0
44
#theme: minimal-mistakes-jekyll
5-
minimal_mistakes_skin: "midnight" # "default" # "air", "aqua", "contrast", "dark", "dirt", "neon", "mint", "plum", "sunrise"
5+
minimal_mistakes_skin: "midnight" # "default", "air", "aqua", "contrast", "dark", "dirt", "midnight", "mint", "neon", "plum", "sunrise"
66

77
# Disable caching of content to disk in order to skip creating a .jekyll-cache or similar directory
88
disable_disk_cache: true

_sass/minimal-mistakes/minimal-mistakes/_archive.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
right: 0;
102102
margin: 0 auto;
103103
padding: 2px 5px;
104-
color: #fff;
104+
color: #fff; // FIXME: archive is not used, add to _variables,scss if used
105105
font-family: $caption-font-family;
106106
font-size: $type-size-8;
107107
background: #000;
@@ -115,7 +115,7 @@
115115
}
116116

117117
a {
118-
color: #fff;
118+
color: #fff;// FIXME: archive is not used, add to _variables,scss if used
119119
text-decoration: none;
120120
}
121121
}

_sass/minimal-mistakes/minimal-mistakes/_forms.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ input[type="file"] {
148148

149149
select {
150150
width: auto;
151-
background-color: #fff;
151+
background-color: red; // FIXME: forms is not used, add to _variables,scss if used
152152
}
153153

154154
select[multiple],
@@ -346,7 +346,7 @@ select:focus {
346346
left: 0;
347347
width: 100%;
348348
height: 100%;
349-
background-color: rgba(255, 255, 255, 0.7);
349+
background-color: rgba(255, 255, 255, 0.7); // FIXME: forms is not used, add to _variables,scss if used
350350
z-index: 10;
351351
}
352352

_sass/minimal-mistakes/minimal-mistakes/_navigation.scss

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
text-align: center;
9090
text-decoration: none;
9191
color: $link-color;
92-
border: 1px solid mix(#000, $border-color, 25%);
92+
border: 1px solid $darker-border-color;
9393
border-radius: 0;
9494

9595
&:hover {
@@ -98,12 +98,12 @@
9898

9999
&.current,
100100
&.current.disabled {
101-
color: #fff;
102-
background: $primary-color;
101+
color: $menuitem-hovered-color;
102+
background-color: $menuitem-hovered-background-color;
103103
}
104104

105105
&.disabled {
106-
color: rgba($muted-text-color, 0.5);
106+
color: $semi-transparent-muted-text-color;
107107
pointer-events: none;
108108
cursor: not-allowed;
109109
}
@@ -166,15 +166,18 @@
166166
text-decoration: none;
167167
color: $link-color;
168168

169-
border: 1px solid mix(#000, $border-color, 25%);
169+
border: 1px solid $darker-border-color;
170170
border-radius: $border-radius;
171171

172172
padding: 16px;
173173
margin-right: 0;
174174
margin-left: 0px;
175175

176176
&:hover {
177-
@include yiq-contrasted($muted-text-color);
177+
//@include yiq-contrasted($muted-text-color);
178+
// This one is confor to the other menu item colors
179+
color: $menuitem-hovered-color;
180+
background-color: $menuitem-hovered-background-color;
178181
}
179182

180183
&:first-child {
@@ -190,7 +193,7 @@
190193
}
191194

192195
&.disabled {
193-
color: rgba($muted-text-color, 0.5);
196+
color: $semi-transparent-muted-text-color;
194197
pointer-events: none;
195198
cursor: not-allowed;
196199
}
@@ -479,13 +482,13 @@
479482
}
480483

481484
&:hover {
482-
color: #fff;
485+
color: $menuitem-hovered-color;
483486
border-color: $gray;
484-
background-color: mix(white, #000, 20%);
487+
background-color: $menuitem-hovered-background-color;
485488

486489
&:before,
487490
&:after {
488-
background-color: #fff;
491+
background-color: $menuitem-background-color;
489492
}
490493
}
491494
}
@@ -526,6 +529,7 @@
526529
.nav__list .nav__items {
527530
/* Also could set the identation of the embedded menu items this way */
528531
margin-left: $sidebar-nav-item-left-margin;
532+
padding-left: 0.5em;
529533
font-size: $type-size-4;
530534

531535
/* Style for the top-level ul */
@@ -565,6 +569,7 @@
565569
transition: 0.2s ease-out;
566570
cursor: pointer;
567571

572+
// Menu item fold/unfold right + -
568573
&:before,
569574
&:after {
570575
content: "";
@@ -585,13 +590,13 @@
585590
margin-left: -0.5em;
586591
padding-left: 0.5em;
587592
padding-right: 0.5em;
588-
color: #fff;
593+
color: $menuitem-hovered-color;
589594
border-color: $gray;
590-
background-color: mix(white, #000, 20%);
595+
background-color: $menuitem-hovered-background-color;
591596

592597
&:before,
593598
&:after {
594-
background-color: #fff;
599+
background-color: $menuitem-background-color;
595600
}
596601
}
597602
}
@@ -625,17 +630,6 @@
625630
transform: rotate(0);
626631
}
627632

628-
// un-folded - background
629-
// input:checked + label {
630-
// color: white;
631-
// background-color: mix(white, #000, 20%);
632-
//
633-
// &:before,
634-
// &:after {
635-
// background-color: #fff;
636-
// }
637-
// }
638-
639633
a {
640634
&:not(.nav__sub-title), &:not(.nav__sub-title) {
641635
margin-right: 3em;
@@ -644,7 +638,7 @@
644638
color: inherit;
645639
}
646640
.active {
647-
@include yiq-contrasted($active-color);
641+
@include yiq-contrasted($menuitem-selected-background-color);
648642
}
649643
&:hover {
650644
text-decoration: underline;
@@ -657,7 +651,7 @@
657651
padding-left: 0.5em;
658652
padding-right: 0.5em;
659653

660-
@include yiq-contrasted($active-color);
654+
@include yiq-contrasted($menuitem-selected-background-color);
661655

662656
&:not(.nav__sub-title) {
663657
margin-left: -0.25em;
@@ -752,11 +746,11 @@
752746
z-index: 99; /* Higher than anything else */
753747
opacity: 0;
754748

755-
color: #c0c0c0;
749+
color: $tooltip-color; // #c0c0c0;
756750
font-size: $type-size-7;
757751
text-align: left;
758-
text-shadow: 1px 1px 2px #111;
759-
background: rgba(51, 51, 51, 0.9);
752+
//text-shadow: 1px 1px 2px $tooltip-text-shadow-color; // #111
753+
background: $tooltip-background-color; // rgba(51, 51, 51, 0.9);
760754

761755
// FIXME: Get rid of the dependency on size of the container
762756
width: 500%;
@@ -785,8 +779,9 @@
785779
padding-right: 15px;
786780

787781
border-radius: 5px;
788-
border: 1px solid rgba(34, 34, 34, 0.9);
789-
box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
782+
box-shadow: 0 0 3px $tooltip-box-shadow-color; // rgba(0, 0, 0, 0.5);
783+
-webkit-box-shadow: 0 0 3px $tooltip-box-shadow-color;
784+
//border: 1px solid $tooltip-border-color; // rgba(34, 34, 34, 0.9);
790785

791786
-webkit-transition: all .2s ease-in-out;
792787
-moz-transition: all .2s ease-in-out;
@@ -811,7 +806,7 @@
811806
top: var(--tooltip-arrow-top, -10px);
812807
left: var(--tooltip-arrow-left, 0px);
813808

814-
border-bottom: var(--tooltip-arrow-border-bottom, 10px) solid rgba(51, 51, 51, 0.9);
809+
border-bottom: var(--tooltip-arrow-border-bottom, 10px) solid $tooltip-arrow-background-color; // rgba(51, 51, 51, 0.9);
815810
border-left: var(--tooltip-arrow-border-left, 10px) solid transparent;
816811
border-right: var(--tooltip-arrow-border-right, 10px) solid transparent;
817812
}
@@ -834,17 +829,17 @@
834829

835830
.toc {
836831
font-family: $sans-serif-narrow;
837-
color: $gray;
832+
color: $menuitem-color;
838833
background-color: $background-color;
839834
border: 1px solid $border-color;
840835
border-radius: $border-radius;
841836
-webkit-box-shadow: $box-shadow;
842837
box-shadow: $box-shadow;
843838

844839
.nav__title {
845-
color: #fff;
846840
font-size: $type-size-6;
847-
background: $primary-color;
841+
color: $menuitem-hovered-color;
842+
background: $menuitem-hovered-background-color;
848843
border: 0px;
849844
border-top-left-radius: $border-radius;
850845
border-top-right-radius: $border-radius;
@@ -856,7 +851,7 @@
856851

857852
// Scrollspy marks toc items as .active when they are in focus
858853
.active a {
859-
@include yiq-contrasted($active-color);
854+
@include yiq-contrasted($menuitem-selected-background-color);
860855
}
861856

862857
h4 {
@@ -882,7 +877,7 @@
882877
a {
883878
display: block;
884879
padding: 0.25rem 0.75rem;
885-
color: $muted-text-color;
880+
color: $menuitem-color;
886881
font-weight: bold;
887882
line-height: 1.5;
888883
border-bottom: 1px solid $border-color;

_sass/minimal-mistakes/minimal-mistakes/_page.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ body {
227227
animation-delay: 0.25s;
228228

229229
a {
230-
color: #fff;
230+
color: #fff; // FIXME: page__hero is not used, add to _variables,scss if used
231231
}
232232

233233
.wrapper {
@@ -243,7 +243,7 @@ body {
243243
.page__meta,
244244
.page__lead,
245245
.btn {
246-
color: #fff;
246+
color: #fff; // FIXME: page__hero is not used, add to _variables,scss if used
247247
text-shadow: 1px 1px 4px rgba(#000, 0.5);
248248
}
249249

@@ -273,7 +273,7 @@ body {
273273
right: 0;
274274
margin: 0 auto;
275275
padding: 2px 5px;
276-
color: #fff;
276+
color: #fff; // FIXME: page__hero is not used, add to _variables,scss if used
277277
font-family: $caption-font-family;
278278
font-size: $type-size-7;
279279
background: #000;
@@ -287,7 +287,7 @@ body {
287287
}
288288

289289
a {
290-
color: #fff;
290+
color: #fff; // FIXME: page__hero is not used, add to _variables,scss if used
291291
text-decoration: none;
292292
}
293293
}

_sass/minimal-mistakes/minimal-mistakes/_print.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
body {
2525
margin: 0 auto;
26-
background: #fff !important;
27-
color: #000 !important;
26+
background: #fff !important; // FIXME: print is not used, add to _variables,scss if used
27+
color: #000 !important; // FIXME: print is not used, add to _variables,scss if used
2828
font-size: 1rem;
2929
line-height: 1.5;
3030
-moz-osx-font-smoothing: grayscale;
@@ -38,7 +38,7 @@
3838
h4,
3939
h5,
4040
h6 {
41-
color: #000;
41+
color: #000; // FIXME: print is not used, add to _variables,scss if used
4242
line-height: 1.2;
4343
margin-bottom: 0.75rem;
4444
margin-top: 0;
@@ -70,7 +70,7 @@
7070

7171
a,
7272
a:visited {
73-
color: #000;
73+
color: #000; // FIXME: print is not used, add to _variables,scss if used
7474
text-decoration: underline;
7575
word-wrap: break-word;
7676
}
@@ -219,12 +219,12 @@
219219
}
220220

221221
.page__hero-caption {
222-
color: #000 !important;
222+
color: #000 !important; // FIXME: print is not used, add to _variables,scss if used
223223
background: #fff !important;
224224
opacity: 1;
225225

226226
a {
227-
color: #000 !important;
227+
color: #000 !important; // FIXME: print is not used, add to _variables,scss if used
228228
}
229229
}
230230

_sass/minimal-mistakes/minimal-mistakes/_reset.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ body { margin: 0; }
3333
/* Selected elements */
3434

3535
::-moz-selection {
36-
color: #fff;
37-
background: #000;
36+
color: $selection-color;
37+
background: $selection-background-color;
3838
}
3939

4040
::selection {

_sass/minimal-mistakes/minimal-mistakes/_utilities.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ body:hover .visually-hidden button {
451451
min-height: 20px;
452452
padding: 19px;
453453
margin-bottom: 20px;
454-
background-color: #f5f5f5;
454+
background-color: red;
455455
border: 1px solid #e3e3e3;
456456
border-radius: $border-radius;
457457
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
@@ -473,7 +473,7 @@ body:hover .visually-hidden button {
473473
width: 100%;
474474
height: 100%;
475475
z-index: 999;
476-
background-color: rgba(255, 255, 255, 0.85);
476+
background-color: rgba($white, 0.85);
477477
}
478478

479479
.modal {

0 commit comments

Comments
 (0)