Skip to content

Commit dca654d

Browse files
committed
Added basic skin switch button skeleton (not finished yet, but functioning)
Signed-off-by: Hofi <hofione@gmail.com>
1 parent 531e877 commit dca654d

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed

_includes/masthead.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,20 @@
2222
</ul>
2323
{% if site.search == true %}
2424
<button class="search__toggle" type="button">
25-
<span id="searchHint" class="">{{ site.data.ui-text[site.locale].search_label | default: "Toggle search (Shift + Ctrl + F or ESC to close)" }}</span>
25+
<span id="searchHint" class="">{{ site.data.ui-text[site.locale].search_label | default: "Toggle search (Shift + Ctrl
26+
+ F or ESC to close)" }}</span>
2627
<i class="fas fa-search"></i>
2728
</button>
2829
{% endif %}
30+
{% if site.skin_switchable == true %}
31+
<span class="skin__toggle_img"><i class="fa fa-sun-o"></i></span>
32+
<button class="skin__toggle" type="button">
33+
<!-- <span id="skinHint" class="">{{ site.data.ui-text[site.locale].search_label | default: "Toggle search (Shift + Ctrl
34+
+ F or ESC to close)" }}</span> -->
35+
<i class="fa fa-toggle-off"></i>
36+
</button>
37+
<span class="skin__toggle_img"><i class="fa fa-moon-o"></i></span>
38+
{% endif %}
2939
<button class="greedy-nav__toggle hidden" type="button">
3040
<span class="visually-hidden">{{ site.data.ui-text[site.locale].menu_label | default: "Toggle menu" }}</span>
3141
<div class="navicon"></div>

_sass/minimal-mistakes/minimal-mistakes/_masthead.scss

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,57 @@
9696
font-weight: 700;
9797
}
9898
}
99+
100+
.skin__toggle {
101+
position: relative;
102+
display: inline-block;
103+
margin-left: 1rem;
104+
margin-right: 1rem;
105+
height: $nav-toggle-height;
106+
border: 0;
107+
outline: none;
108+
color: $primary-color;
109+
background-color: transparent;
110+
cursor: pointer;
111+
-webkit-transition: 0.2s;
112+
transition: 0.2s;
113+
114+
&:hover {
115+
color: mix(#000, $primary-color, 25%);
116+
}
117+
}
118+
119+
.skin-icon {
120+
width: 100%;
121+
height: 100%;
122+
}
123+
124+
.skin__toggle_img {
125+
position: relative;
126+
display: inline-block;
127+
margin-left: 0rem;
128+
margin-right: 0rem;
129+
width: calc($nav-toggle-height * 0.75);
130+
height: calc($nav-toggle-height * 0.75);
131+
border: 0;
132+
outline: none;
133+
color: $primary-color;
134+
background-color: transparent;
135+
-webkit-transition: 0.2s;
136+
transition: 0.2s;
137+
138+
&:hover {
139+
color: mix(#000, $primary-color, 25%);
140+
}
141+
}
142+
143+
#skinHint {
144+
display: none;
145+
position: absolute;
146+
top: 50%;
147+
transform: translateY(-50%);
148+
left: -110px;
149+
max-width: 100px;
150+
font-size: 12px;
151+
margin-left: 10px;
152+
}

0 commit comments

Comments
 (0)