Skip to content

Commit 0b36241

Browse files
authored
fix: style issues in mobile (#823)
1 parent 5b2cc19 commit 0b36241

6 files changed

Lines changed: 116 additions & 28 deletions

File tree

_sass/minimal-mistakes/_page.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,8 @@ span.date {
680680
}
681681
#main {
682682
padding: 0 .6rem;
683+
max-width: 100%;
684+
overflow-x: hidden;
683685
}
684686
.page__title {
685687
max-width: 100%;

_sass/minimal-mistakes/_pyos-cards.scss

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,12 +478,41 @@
478478
}
479479
}
480480

481-
// Responsive adjustments for people cards
481+
// Responsive adjustments (align with home page card scale: padding 0.75em, title 1rem, body 0.875rem)
482482
@media screen and (max-width: $mobile) {
483+
.people-card .people-card__content {
484+
padding: 0.75em;
485+
}
486+
483487
.people-card {
484-
.people-card__content {
485-
.ppl_social {
486-
font-size: 0.9em !important;
488+
h4.person_name {
489+
font-size: 1rem;
490+
}
491+
492+
p.page__meta,
493+
p.contrib_org,
494+
.ppl_social {
495+
font-size: 0.875rem;
496+
}
497+
}
498+
499+
.upcoming-events-list .event-card {
500+
.event-card__date {
501+
padding: 0.75em;
502+
}
503+
.event-card__date-text {
504+
font-size: 1rem;
505+
span:last-of-type {
506+
font-size: 0.75rem;
507+
}
508+
}
509+
.event-card__details {
510+
padding: 0.75em;
511+
h3 {
512+
font-size: 1rem;
513+
}
514+
p {
515+
font-size: 0.875rem;
487516
}
488517
}
489518
}

_sass/minimal-mistakes/_pyos-grid.scss

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,25 @@ $colors: (
177177

178178
// Home page new contributors: single row of 5, smaller cards, more gap
179179
&.entries-grid--contributors {
180-
grid-template-columns: repeat(5, 1fr);
180+
grid-template-columns: 1fr; // Mobile: 1 column
181181
grid-gap: 1rem;
182182
justify-items: center;
183183
> * {
184184
max-width: 200px;
185185
min-width: 0;
186186
width: 100%;
187187
}
188+
@media (min-width: $small) {
189+
grid-template-columns: repeat(2, 1fr); // Small: 2 columns
190+
}
191+
192+
@media (min-width: $medium) {
193+
grid-template-columns: repeat(3, 1fr); // Medium: 3 columns
194+
}
195+
196+
@media (min-width: $large) {
197+
grid-template-columns: repeat(5, 1fr); // Large: 5 columns
198+
}
188199
.people-card {
189200
h4.person_name {
190201
font-size: 0.95rem;
@@ -226,14 +237,14 @@ $colors: (
226237
.packages-grid {
227238
display: grid;
228239
grid-gap: 10px;
229-
grid-template-columns: 1fr; // Mobile: 1 column
240+
grid-template-columns: minmax(0, 1fr); // Mobile: 1 column, allow shrink
230241

231242
@media (min-width: $small) {
232-
grid-template-columns: repeat(2, 1fr); // Small: 2 columns
243+
grid-template-columns: repeat(2, minmax(0, 1fr)); // Small: 2 columns
233244
}
234245

235246
@media (min-width: $medium) {
236-
grid-template-columns: repeat(3, 1fr); // Medium and above: 3 columns (max)
247+
grid-template-columns: repeat(3, minmax(0, 1fr)); // Medium and above: 3 columns (max)
237248
}
238249

239250
// Feature package cards - compact display
@@ -564,16 +575,26 @@ $colors: (
564575

565576

566577

567-
/* max 480 px */
578+
/* max 480 px - unified home page card scale */
568579
@media screen and (max-width: $mobile) {
569-
// large buttons are disproportionately large
570-
// Elements outside of notice blocks such as the blog page
580+
// Shared scale: card padding 0.75em, title 1rem, body 0.875rem
581+
.cards.highlight .card-body {
582+
padding: 0.75em;
583+
p {
584+
font-size: 0.875rem;
585+
}
586+
h2.card-title {
587+
font-size: 1rem;
588+
}
589+
}
590+
571591
.blog__grid {
572592
h3.card__title-container {
573593
padding: 0;
574594
}
575595
.card-excerpt p {
576-
line-height: 1.8rem;
596+
line-height: 1.5;
597+
font-size: 0.875rem;
577598
}
578599
.card__bkg .card__title-container {
579600
padding: 0;
@@ -590,30 +611,35 @@ $colors: (
590611

591612
// the home page has this grid in a notice block
592613
.notice {
593-
.card-body p, .card-body h2 {
594-
line-height: 1.1;
595-
padding: 0rem 1rem;
596-
font-size: .9rem;
597-
}
598614

599615
.blog__grid {
600-
font-size: 1.3em;
601-
grid-template-columns: repeat(auto-fill, minmax(95%, 1fr))!important;
616+
font-size: 1rem;
617+
grid-template-columns: repeat(auto-fill, minmax(95%, 1fr)) !important;
602618
grid-auto-rows: 0fr!important;
603619
grid-column-gap: 7px;
604620
grid-row-gap: 1rem!important;
605621
margin-bottom: 5rem;
606622
padding: 0;
607623

608624
.card-body {
609-
font-size: .95rem;
625+
padding: 0.75em;
626+
font-size: 0.875rem;
627+
}
628+
.card-body p,
629+
.card-body h2 {
630+
line-height: 1.4;
631+
padding: 0;
632+
font-size: 0.875rem;
633+
}
634+
h3.card-title {
635+
font-size: 1rem;
610636
}
611637
.cards {
612-
margin: 0 0! important;
638+
margin: 0 0 !important;
613639
}
614640

615-
& a {
616-
font-size: 1.3em;
641+
a {
642+
font-size: 1em;
617643
}
618644
}
619645

_sass/minimal-mistakes/_pyos-isotope.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,4 +303,19 @@ input[type="text"] {
303303
margin-left: 0;
304304
margin-right: 0;
305305
}
306+
307+
// Align with blog cards: padding 0.75em, title 0.9rem, body 0.875rem
308+
.package-card .package-card__content {
309+
padding: 0.75em !important;
310+
}
311+
312+
.package-card .package-card__title {
313+
font-size: 0.9rem;
314+
word-break: break-word;
315+
}
316+
317+
.package-card .package-card__meta,
318+
.package-card .package-card__description {
319+
font-size: 0.875rem;
320+
}
306321
}

_sass/minimal-mistakes/_pyos-main.scss

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ img {
2525
}
2626

2727

28-
div > div {
28+
div > div:not(.package-card__content) {
2929
padding: 10px;
3030
}
3131

@@ -54,9 +54,10 @@ h2.clearall {
5454
font-size: .9em;
5555
}
5656

57-
58-
.wide .archive {
59-
width: calc(100% - 100px);
57+
@include breakpoint($large) {
58+
.wide .archive {
59+
width: calc(100% - 100px);
60+
}
6061
}
6162

6263
.wide__p_text {
@@ -135,7 +136,10 @@ h2.clearall {
135136
width: 100%!important;
136137
}
137138

138-
h1, h2, h3, .archive__item-title {
139+
h1,
140+
h2,
141+
h3:not(.package-card__title),
142+
.archive__item-title {
139143
font-size: 1.6em!important;
140144
}
141145
.btn--large {

_sass/minimal-mistakes/_utilities.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ body:hover .visually-hidden button {
103103
white-space: nowrap;
104104
}
105105

106+
/*
107+
Narrow text utility
108+
========================================================================== */
109+
110+
.narrow {
111+
font-size: 0.9em !important;
112+
}
113+
114+
.narrow p {
115+
font-size: 0.9em !important;
116+
}
117+
106118
/*
107119
Task lists
108120
========================================================================== */

0 commit comments

Comments
 (0)