Skip to content

Commit 15f897d

Browse files
authored
enh: fix donate button and clean up style bugs (#777)
* enh: clean up top nav * enh: final css cleanup * enh: alignment in donate button
1 parent cd4158b commit 15f897d

File tree

8 files changed

+161
-61
lines changed

8 files changed

+161
-61
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">

_includes/package-grid.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% assign use_isotope = include.isotope | default: false %}
2+
{% assign is_feature = include.feature %}
23

34
{% if use_isotope %}
45
<div class="element-item package-card {% for aCategory in apackage.categories %}
@@ -41,6 +42,7 @@ <h3 class="package-card__title" itemprop="name">
4142
{{ apackage.package_description | markdownify }}
4243
</div>
4344

45+
{% unless is_feature %} HI there
4446
<ul class="package-card__links">
4547
<li><a href="{{ apackage.repository_link }}" rel="permalink"><i class="fab fa-github" aria-hidden="true"></i> View Code</a></li>
4648
{% if apackage.gh_meta.documentation %}
@@ -57,5 +59,6 @@ <h3 class="package-card__title" itemprop="name">
5759
<li class="package-card__archived"><i class="fa-solid fa-box-archive" aria-hidden="true"></i> Archived</li>
5860
{% endif %}
5961
</ul>
62+
{% endunless %}
6063
</div>
6164
</div>

_pages/about-peer-review.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ We are deeply grateful for those served on our editorial board previously!
157157
{% assign packages_sorted = site.data.packages | sort_natural: 'date_accepted' | reverse %}
158158

159159
<div class="grid">
160-
{% for apackage in packages_sorted limit:4 %}
161-
{% include package-grid.html %}
160+
{% for apackage in packages_sorted limit:3 %}
161+
{% include package-grid.html feature=true %}
162162
{% endfor %}
163163
</div>
164164

_pages/home.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ peer-review:
136136

137137
<div class="packages-grid">
138138
{% for apackage in packages_sorted limit:3 %}
139-
{% include package-grid.html %}
139+
{% include package-grid.html feature=true %}
140140
{% endfor %}
141141
</div>
142142

_sass/minimal-mistakes/_masthead.scss

Lines changed: 96 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
==========================================================================
33
MASTHEAD
44
5-
Layout of the top-level items within the masthead.
6-
For styling of menu contents, see _pyos-dropdown.scss
5+
Layout and styling of the top-level items within the masthead.
6+
For dropdown menu functionality, see _pyos-dropdown.scss
77
==========================================================================
88
*/
99

1010
.masthead {
1111
position: relative;
1212
border-bottom: 1px solid $border-color;
13+
padding-bottom: 0.15rem; // Add space below navigation to prevent overlap
1314
-webkit-animation: $intro-transition;
1415
animation: $intro-transition;
1516
-webkit-animation-delay: 0.15s;
@@ -22,19 +23,23 @@ For styling of menu contents, see _pyos-dropdown.scss
2223
margin: auto;
2324
padding: 0 1em;
2425
max-width: 100%;
25-
height: 3rem;
26+
height: 4rem; // Increased from 3rem to accommodate taller logo
2627
display: flex;
2728
justify-content: space-between;
2829
font-family: $sans-serif-narrow;
2930
position: relative;
3031
align-items: stretch;
31-
min-height: 2em;
32+
min-height: 3rem; // Increased from 2em to ensure adequate height
3233
background: #fff;
3334

3435
& > * {
3536
margin: auto;
3637
}
3738

39+
.nav__links {
40+
margin: 0;
41+
}
42+
3843
a {
3944
text-decoration: none;
4045
}
@@ -63,19 +68,28 @@ For styling of menu contents, see _pyos-dropdown.scss
6368
justify-content: center;
6469
align-items: center;
6570
padding: 0.5em 0;
71+
margin-bottom: 0; // Ensure no extra margin causing overlap
72+
flex-shrink: 0; // Prevent logo from shrinking in flexbox
73+
flex-grow: 0; // Prevent logo from growing in flexbox
74+
75+
// Responsive adjustments for mobile
76+
@media (max-width: $medium) {
77+
padding: 0.25em 0; // Reduce padding on mobile but keep logo size
78+
}
6679

6780
&::after {
6881
display: none;
6982
}
7083

7184
img {
7285
object-fit: contain;
73-
height: 2.5em;
86+
height: 2.5rem; // Use rem instead of em for consistent size across breakpoints
7487
width: auto;
7588
margin: 0;
7689
display: block;
7790
box-shadow: none;
7891
align-self: center;
92+
max-height: 2.5rem; // Ensure it never exceeds this size
7993
}
8094
}
8195

@@ -94,3 +108,80 @@ For styling of menu contents, see _pyos-dropdown.scss
94108
font-size: .8em;
95109
color: $nav-font-color;
96110
}
111+
112+
/*
113+
==========================================================================
114+
NAVIGATION LINKS STYLING
115+
==========================================================================
116+
*/
117+
118+
/* Donate button and search in navigation */
119+
.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+
153+
.donate-btn {
154+
margin-left: 0;
155+
padding: 0.5em 0.75em;
156+
font-size: 0.8em;
157+
font-weight: 500;
158+
white-space: nowrap;
159+
text-decoration: none;
160+
display: inline-flex;
161+
align-items: center;
162+
justify-content: center;
163+
height: auto;
164+
line-height: 1.3;
165+
border: 1px solid $pyos-darkpurple;
166+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
167+
transition: box-shadow 0.3s ease, transform 0.2s ease, color 0.3s ease;
168+
background-color: $pyos-darkpurple;
169+
color: $pyos-white !important;
170+
171+
&:hover {
172+
box-shadow: 0 10px 15px rgba(0, 0, 0, 0.15), 0 4px 6px rgba(0, 0, 0, 0.1);
173+
transform: translateY(-1px);
174+
color: $pyos-lightpurple !important;
175+
}
176+
177+
@include breakpoint($medium) {
178+
margin-left: 0;
179+
}
180+
181+
@media (max-width: $medium) {
182+
margin-left: 0;
183+
width: 100%;
184+
justify-content: center;
185+
}
186+
}
187+
}

_sass/minimal-mistakes/_pyos-dropdown.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@
314314
color: $pyos-white;
315315
}
316316

317-
@media screen and (max-width: $medium) {
318-
/* Hide horizontal drop down links at 48em / 768px */
317+
@media screen and (max-width: $large) {
318+
/* Hide horizontal drop down links at $large / 1024px (closest to 1026px) */
319319
.nav__links {
320320
display: none;
321321
}

_sass/minimal-mistakes/_pyos-grid.scss

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ $colors: (
176176
}
177177
}
178178

179-
// Home page packages section - fixed breakpoints
179+
// Home page packages section - fixed breakpoints (max 3 columns for better spacing)
180180
.packages-grid {
181181
display: grid;
182182
grid-gap: 10px;
@@ -187,11 +187,45 @@ $colors: (
187187
}
188188

189189
@media (min-width: $medium) {
190-
grid-template-columns: repeat(3, 1fr); // Medium: 3 columns
190+
grid-template-columns: repeat(3, 1fr); // Medium and above: 3 columns (max)
191191
}
192192

193-
@media (min-width: $large) {
194-
grid-template-columns: repeat(4, 1fr); // Large: 4 columns
193+
// Feature package cards - compact display
194+
.package-card {
195+
.package-card__content {
196+
padding: 1.25em;
197+
}
198+
199+
.package-card__title {
200+
font-size: 1.5em;
201+
}
202+
203+
.package-card__meta {
204+
font-size: 0.75em;
205+
}
206+
207+
.package-card__description p {
208+
font-size: 1.1em;
209+
line-height: 1.5em;
210+
}
211+
}
212+
}
213+
214+
.grid .package-card {
215+
.package-card__content {
216+
padding: 1.25em;
217+
}
218+
219+
.package-card__title {
220+
font-size: 1.0375em;
221+
}
222+
223+
.package-card__meta {
224+
font-size: 0.75em;
225+
}
226+
227+
.package-card__description {
228+
font-size: 0.8125em;
195229
}
196230
}
197231

@@ -286,16 +320,20 @@ $colors: (
286320
.grid-item {
287321
display: flex;
288322
flex-direction: column;
289-
background: $pyos-mediumpurple;
290-
border: 1px solid #ddd;
323+
background: transparent;
324+
border: none;
291325
border-radius: 8px;
292-
overflow: hidden;
326+
overflow: visible;
293327
padding: 0;
294328
}
295329

330+
.cards.highlight {
331+
margin: 0 !important;
332+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08) !important;
333+
}
296334

297-
div>div {
298-
padding:0;
335+
div > div {
336+
padding: 0;
299337
}
300338
}
301339

@@ -304,6 +342,7 @@ $colors: (
304342
display: flex;
305343
flex-direction: column;
306344
height: 100%;
345+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
307346

308347
.cards__image {
309348
max-height: 200px;
@@ -322,6 +361,7 @@ $colors: (
322361

323362
&:hover {
324363
cursor: default;
364+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08); // Maintain shadow on hover (override base .cards hover shadow)
325365
}
326366

327367
.card-body {

_sass/minimal-mistakes/_pyos-main.scss

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -156,38 +156,3 @@ h2.clearall {
156156
padding-left: 1em;
157157
}
158158
}
159-
160-
/* Donate button in navigation */
161-
.nav__links {
162-
.donate-btn {
163-
margin-left: 0.75em;
164-
margin-top: 0.5em;
165-
padding: 0.25em 0.5em;
166-
font-size: 0.8em;
167-
white-space: nowrap;
168-
text-decoration: none;
169-
display: inline-flex;
170-
align-items: center;
171-
height: auto;
172-
line-height: 1.3;
173-
border: 1px solid $pyos-darkpurple;
174-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
175-
transition: box-shadow 0.3s ease, transform 0.2s ease;
176-
177-
&:hover {
178-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
179-
transform: translateY(-1px);
180-
}
181-
182-
@include breakpoint($medium) {
183-
margin-left: 1em;
184-
}
185-
186-
@media (max-width: $medium) {
187-
margin-left: 0;
188-
margin-top: 0;
189-
width: 100%;
190-
justify-content: center;
191-
}
192-
}
193-
}

0 commit comments

Comments
 (0)