Skip to content

Commit 624c727

Browse files
committed
fix(training): mobile spacing and width
- Centered CTA text and images - Expanded CTA text width for better readability - Centered iframe logo grid
1 parent c75d9b3 commit 624c727

File tree

2 files changed

+53
-12
lines changed

2 files changed

+53
-12
lines changed

layouts/shortcodes/cncf-landscape.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
{{- end -}}
5959
<div id="frameHolder">
6060
{{ if ( .Get "category" ) }}
61-
<iframe id="iframe-landscape" src="https://landscape.cncf.io/embed/embed.html?key={{ .Get "category" }}&headers=false&style=shadowed&size=md&bg-color=%233371e3&fg-color=%23ffffff&iframe-resizer=true" style="width: 1px; min-width: 100%; min-height: 100px; border: 0;"></iframe>
61+
<iframe id="iframe-landscape" src="https://landscape.cncf.io/embed/embed.html?key={{ .Get "category" }}&headers=false&style=shadowed&size=md&bg-color=%233371e3&fg-color=%23ffffff&iframe-resizer=true" style="width: 1px; min-height: 100px; border: 0;"></iframe>
6262
<script>
6363
iFrameResize({ }, '#iframe-landscape');
6464
</script>

static/css/training.css

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ body.cid-training section.call-to-action .main-section .cta-text > * {
4545
text-align: center;
4646
/* if max() and min() are available, use them */
4747
min-width: min(20em, 50vw);
48-
max-width: min(1000px, 50vw);
48+
max-width: min(1000px, 80vw);
4949
}
5050

5151
/*Image Container for further position of image in smaller devices*/
@@ -120,25 +120,38 @@ body.cid-training #get-certified .col-nav a.button {
120120
body.cid-training section.call-to-action .main-section .cta-image > img {
121121
width: 7rem;
122122
}
123-
body.cid-training section.call-to-action .main-section > div.call-to-action > div {
124-
padding: 0 2rem 0 2rem;
123+
124+
/* Ensure kubestronaut image maintains proper size */
125+
body.cid-training #cta-kubestronaut .cta-image > img {
126+
width: 150px;
127+
margin: 0 auto;
128+
display: block;
125129
}
126-
body.cid-training section.call-to-action .main-section > div.call-to-action div.cta-image {
127-
padding: 0 2rem 0 2rem;
128-
/* Change display to CSS Grid layout with 2 columns that autofill */
129-
display: grid;
130-
grid-template-columns: repeat(auto-fill, minmax(50%, 1fr));
130+
body.cid-training section.call-to-action .main-section > div.call-to-action > div {
131+
padding: 0 1rem 0 1rem;
131132
}
132-
/* Make the CTA text fill 100% of the viewport */
133-
body.cid-training section.call-to-action .main-section > div.call-to-action > div.cta-text {
133+
134+
135+
/* Updated styles for CTA text content at 945px breakpoint */
136+
body.cid-training #cta-kubestronaut .cta-text,
137+
body.cid-training #cta-certification .cta-text {
134138
width: 100%;
139+
max-width: 700px;
140+
margin: 0 auto;
141+
}
142+
143+
body.cid-training #cta-kubestronaut .cta-text > *,
144+
body.cid-training #cta-certification .cta-text > * {
145+
text-align: center;
146+
max-width: 100%;
147+
min-width: auto;
135148
}
136149

137150
/* Resize the div that contains the images so that the images wrap 2 at a time
138151
and have no margin issues */
139152

153+
/* sizing here */
140154
body.cid-training section.call-to-action .main-section > div.call-to-action {
141-
width: 60%;
142155
margin: auto;
143156
padding-top: 20px;
144157
}
@@ -149,6 +162,19 @@ body.cid-training #get-certified .col-nav a.button {
149162
grid-template-columns: repeat(2, 120px);
150163
gap: 0;
151164
}
165+
166+
/* Special handling for kubestronaut container with single image */
167+
body.cid-training #cta-kubestronaut .cta-img-container {
168+
display: flex;
169+
justify-content: center;
170+
align-items: center;
171+
width: 100%;
172+
}
173+
174+
body.cid-training #cta-kubestronaut .logo-certification {
175+
padding: 0;
176+
margin: 0 auto;
177+
}
152178

153179
body.cid-training #logo-kcnf{
154180
grid-column: 1 / span 2;
@@ -204,6 +230,10 @@ body.cid-training #get-certified .col-nav a.button {
204230
}
205231
body.cid-training .col-container {display: flex; flex-direction: column; }
206232
body.cid-training .col-container .col-nav:last-child{width: 100%;}
233+
234+
body.cid-training section.call-to-action .main-section > div.call-to-action > div {
235+
padding: 0 .5rem 0 .5rem;
236+
}
207237
}
208238

209239
body.cid-training .button {
@@ -270,4 +300,15 @@ body.cid-training #landscape {
270300
visibility: visible;
271301
overflow: hidden;
272302
width: 100%;
303+
}
304+
305+
/* center logo grid iframe across all breakpoints*/
306+
#frameHolder {
307+
display: flex;
308+
justify-content: center;
309+
}
310+
#iframe-landscape {
311+
flex: 0 1 80%;
312+
max-width: 1200px;
313+
min-width: 0;
273314
}

0 commit comments

Comments
 (0)