Skip to content

Commit b1d7776

Browse files
committed
Homepace responsiveness (fixed!)
1 parent 4c482ce commit b1d7776

File tree

6 files changed

+97
-42
lines changed

6 files changed

+97
-42
lines changed

assets/css/styles.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

front/src/styles/modules.scss

+66-23
Original file line numberDiff line numberDiff line change
@@ -118,31 +118,56 @@
118118
overflow: hidden;
119119

120120
.content {
121-
z-index: 1;
122-
position: relative;
123-
width: 500px;
124-
max-width: 100%;
125-
margin-right: auto;
126-
margin-left: 0;
127-
padding-top: 96px !important; // to override vocab
121+
padding: 0 $space-big !important; // :-(
122+
padding-top: $space-bigger !important; // :-(
128123

129-
@include touch() {
130-
padding: $space-small;
124+
@include tablet() {
125+
z-index: 1;
126+
position: relative;
127+
width: 500px;
128+
max-width: 100%;
129+
margin-right: auto;
130+
margin-left: 0;
131+
padding: 0;
132+
padding-top: 96px !important; // to override vocab
131133
}
132134
}
133135

134136
.img-wrapper {
135-
position: absolute;
136-
top: 0;
137-
left: 0;
138-
right: 0;
139-
text-align: right;
140-
z-index: 0;
141-
142137
img {
143-
width: calc(100% - 400px); // container width - content width
144-
margin-right: -4rem;
145-
height: auto;
138+
width: 100%;
139+
margin-bottom: -6rem;
140+
}
141+
142+
@include mobile {
143+
&:after {
144+
content: "";
145+
position: absolute;
146+
top: calc(100% + 4rem);
147+
left: 0;
148+
right: 0;
149+
bottom: 0;
150+
width: 100%;
151+
display: block;
152+
background-color: whitesmoke;
153+
height: 2000px;
154+
z-index: 1;
155+
}
156+
}
157+
158+
@include tablet() {
159+
position: absolute;
160+
top: 0;
161+
left: 0;
162+
right: 0;
163+
text-align: right;
164+
z-index: 0;
165+
166+
img {
167+
width: calc(100% - 400px); // container width - content width
168+
margin-right: -4rem;
169+
height: auto;
170+
}
146171
}
147172
}
148173

@@ -152,10 +177,22 @@
152177
z-index: 2;
153178
}
154179

155-
@include touch() {
156-
.courses {
157-
max-width: calc(100% - #{$space-small});
158-
margin: 0 auto;
180+
.courses {
181+
@include mobile() {
182+
.course {
183+
margin-bottom: $space-normal;
184+
}
185+
}
186+
187+
@include touch() {
188+
padding: 0 $space-big;
189+
}
190+
191+
@include tablet() {
192+
display: flex;
193+
align-items: stretch;
194+
column-gap: $space-larger;
195+
margin-bottom: $space-bigger;
159196
}
160197
}
161198

@@ -172,6 +209,12 @@
172209
}
173210
}
174211

212+
.wp-theme-certificates .after-faq {
213+
@include touch() {
214+
margin-top: $space-xl;
215+
}
216+
}
217+
175218
// FAQ Page
176219
.wp-theme-certificates.page-template-template-faq {
177220
.faq-sidebar {

front/src/styles/shame.scss

+14
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,17 @@ span.icon {
7575
.navbar-brand {
7676
margin-left: 0 !important;
7777
}
78+
79+
// Fix bad coluns ruining the entire layout
80+
main {
81+
max-width: 100%;
82+
display: block;
83+
overflow-x: hidden;
84+
}
85+
86+
.padding-touch-horizontal {
87+
@include touch() {
88+
padding-left: $space-big;
89+
padding-right: $space-big;
90+
}
91+
}

inc/partials/home-faq.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<p class="has-color-dark-slate-gray">
1515
<?php echo $faq['question']; ?>
1616
</p>
17-
<span class="icon has-text-black">
17+
<span class="margin-left-small icon has-text-black">
1818
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -256 1792 1792" class="caret">
1919
<path fill="currentColor" d="M1426.44 407.864q0 26-19 45l-448 448q-19 19-45 19t-45-19l-448-448q-19-19-19-45t19-45q19-19 45-19h896q26 0 45 19t19 45z"/>
2020
</svg>

inc/partials/home-hero.php

+12-14
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,26 @@
2929
<!-- Featured Courses -->
3030
<?php if( have_rows('featured_courses') ): ?>
3131
<div class="container">
32-
<ul class="courses columns is-variable is-5 is-desktop">
32+
<ul class="courses">
3333
<?php while( have_rows('featured_courses') ): the_row();
3434
$title = get_sub_field('title');
3535
$description = get_sub_field('description');
3636
$featured_course = get_sub_field('featured_course');
3737
?>
38-
<li class="column">
39-
<div class="padding-bigger has-background-white body-normal">
40-
<h2 class="title is-3"><?php echo $title; ?></h2>
41-
<p class="margin-top-big"><?php echo $description; ?></p>
42-
<?php if ($featured_course) : ?>
43-
<a
44-
class="has-text-success is-block has-text-weight-bold body-big margin-top-big"
45-
href="<?php echo $featured_course; ?>">
46-
See course
47-
</a>
48-
<?php endif; ?>
49-
</div>
38+
<li class="course padding-bigger has-background-white body-normal">
39+
<h2 class="title is-3"><?php echo $title; ?></h2>
40+
<p class="margin-top-big"><?php echo $description; ?></p>
41+
<?php if ($featured_course) : ?>
42+
<a
43+
class="has-text-success is-block has-text-weight-bold body-big margin-top-big"
44+
href="<?php echo $featured_course; ?>">
45+
See course
46+
</a>
47+
<?php endif; ?>
5048
</li>
5149
<?php endwhile; ?>
5250
</ul>
53-
<div class="additional-info padding-top-small padding-bottom-bigger body-bigger">
51+
<div class="additional-info padding-top-small padding-bottom-bigger body-bigger padding-touch-horizontal">
5452
<?php echo $additional_info; ?>
5553
</div>
5654
</div>

page-home.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
include get_template_part('inc/partials/home', 'hero');
2424
?>
2525

26-
<section class="has-background-grey-lighter padding-top-big padding-bottom-xl">
26+
<section class="has-background-grey-lighter padding-top-big padding-bottom-xl padding-touch-horizontal">
2727
<div class="container">
2828

2929
<div class="columns is-variable is-6 padding-bottom-xl">
3030
<div class="column is-two-thirds">
3131
<?php include get_template_part('inc/partials/home', 'faq'); ?>
3232
</div>
3333
<?php // Links Section (Hardcoded for now) ?>
34-
<div class="column">
34+
<div class="column after-faq">
3535
<h5 class="margin-bottom-normal"><a href="" class="has-text-forest-green">Course Content</a></h5>
3636
<p>Access current course content here. Unless otherwise noted, all course content is licensed CC BY 4.0. Also available in audio and remixed for a book publication!</p>
3737

@@ -62,7 +62,7 @@
6262

6363
</div>
6464
</section>
65-
<section class="padding-top-xl padding-bottom-xxl">
65+
<section class="padding-top-xl padding-bottom-xxl padding-touch-horizontal">
6666
<div class="container">
6767

6868
<div class="padding-bottom-xl">

0 commit comments

Comments
 (0)