Skip to content

Commit 4b9b55b

Browse files
committed
enh: alignment in donate button
1 parent d17f79a commit 4b9b55b

File tree

2 files changed

+53
-15
lines changed

2 files changed

+53
-15
lines changed

_includes/masthead.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@
3636
</ul>
3737
</li>
3838
{% elsif alink.is_button %}
39+
{% if site.search == true %}
40+
<li>
41+
<button class="search__toggle" type="button">
42+
<span class="visually-hidden">{{ site.data.ui-text[site.locale].search_label | default: "Toggle search" }}</span>
43+
<i class="fas fa-search"></i>
44+
</button>
45+
</li>
46+
{% endif %}
3947
<li>
4048
<a href="{{ alink.url }}" class="btn btn--primary donate-btn" target="_blank" rel="noopener noreferrer">
4149
{{ alink.title }}
@@ -51,13 +59,6 @@
5159
{% endfor %}
5260
</ul>
5361

54-
{% if site.search == true %}
55-
<button class="search__toggle" type="button">
56-
<span class="visually-hidden">{{ site.data.ui-text[site.locale].search_label | default: "Toggle search" }}</span>
57-
<i class="fas fa-search"></i>
58-
</button>
59-
{% endif %}
60-
6162
<ul class="hidden-links hidden"></ul>
6263
<!-- Burger button - span class for screen readers-->
6364
<button class="hamburger__btn-toggle" type="button" count="1" aria-expanded="false">

_sass/minimal-mistakes/_masthead.scss

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ For dropdown menu functionality, see _pyos-dropdown.scss
3636
margin: auto;
3737
}
3838

39+
.nav__links {
40+
margin: 0;
41+
}
42+
3943
a {
4044
text-decoration: none;
4145
}
@@ -111,38 +115,71 @@ NAVIGATION LINKS STYLING
111115
==========================================================================
112116
*/
113117

114-
/* Donate button in navigation */
118+
/* Donate button and search in navigation */
115119
.nav__links {
120+
display: flex;
121+
align-items: stretch;
122+
height: 100%;
123+
124+
li {
125+
display: flex;
126+
align-items: center;
127+
}
128+
129+
.search__toggle {
130+
margin-left: 0 !important;
131+
margin-right: 0.75em !important;
132+
padding: 14px 12px;
133+
background: transparent;
134+
border: none;
135+
color: $nav-font-color;
136+
cursor: pointer;
137+
display: flex;
138+
align-items: center;
139+
justify-content: center;
140+
font-size: 1em;
141+
height: 100%;
142+
transition: color 0.2s ease;
143+
144+
&:hover {
145+
color: $pyos-darkpurple;
146+
}
147+
148+
i {
149+
font-size: 1em;
150+
}
151+
}
152+
116153
.donate-btn {
117-
margin-left: 0.75em;
118-
margin-top: 0.5em;
119-
padding: 0.25em 0.5em;
154+
margin-left: 0;
155+
padding: 0.5em 0.75em;
120156
font-size: 0.8em;
157+
font-weight: 500;
121158
white-space: nowrap;
122159
text-decoration: none;
123160
display: inline-flex;
124161
align-items: center;
162+
justify-content: center;
125163
height: auto;
126164
line-height: 1.3;
127165
border: 1px solid $pyos-darkpurple;
128166
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
129167
transition: box-shadow 0.3s ease, transform 0.2s ease, color 0.3s ease;
130168
background-color: $pyos-darkpurple;
131-
color: $pyos-white !important; // override because the rest of the nav is dark
169+
color: $pyos-white !important;
132170

133171
&:hover {
134172
box-shadow: 0 10px 15px rgba(0, 0, 0, 0.15), 0 4px 6px rgba(0, 0, 0, 0.1);
135173
transform: translateY(-1px);
136-
color: $pyos-lightpurple !important; // subtle light purple on hover
174+
color: $pyos-lightpurple !important;
137175
}
138176

139177
@include breakpoint($medium) {
140-
margin-left: 1em;
178+
margin-left: 0;
141179
}
142180

143181
@media (max-width: $medium) {
144182
margin-left: 0;
145-
margin-top: 0;
146183
width: 100%;
147184
justify-content: center;
148185
}

0 commit comments

Comments
 (0)