Skip to content

Conversation

ritorhymes
Copy link
Contributor

@ritorhymes ritorhymes commented Sep 18, 2025

Description

There is a related group of mobile formatting issues on the "training" page for three sections including two CTA blocks and a Partnership logo grid iframe. The issues are a lack of consistent centering of elements that are unintentionally offset (including the logo grid hugging the left page margin) and an overly narrow width constraining the CTA text elements affecting page balance and readability.

Solutions

  • Remove offset to properly center CTA text and images.
  • Expand CTA text width for better page balance and readability.
  • Center iframe logo grid (Note: this iframe's column rendering behavior will ALWAYS result in a slight offset in certain intermittent screen sizes).
  • Modifications made in training.css and inline style for cncf-landscape.html; no content is modified.

Screenshots

CTA - Section 1

Before
before-topCTA

After
after-topCTA

CTA - Section 2

Before
before-bottomCTA

After
after-bottomCTA

iframe Logo Grid - Section 3

Before
before-logogrid

After
after-logogrid

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 18, 2025
@k8s-ci-robot k8s-ci-robot added the area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes label Sep 18, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign katcosgrove for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 18, 2025
Copy link

netlify bot commented Sep 18, 2025

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 00a5512
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-io-main-staging/deploys/68d10a2de95c370008fab205
😎 Deploy Preview https://deploy-preview-52398--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@lmktfy lmktfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

I want to make sure I understand the rationale, especially around the changes to how we lay out the logos for the individual certifications.

#iframe-landscape {
flex: 0 1 80%;
max-width: 1200px;
min-width: 0 !important;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this without using !important? For me, that marker should always be a very last resort.

Copy link
Contributor Author

@ritorhymes ritorhymes Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just refactored and pushed. cncf-landscape.html has both of these elements styled inline so I added the style changes inline there also. So they're no longer in the stylesheet, and goodbye !important!

Comment on lines -126 to -130
body.cid-training section.call-to-action .main-section > div.call-to-action div.cta-image {
padding: 0 2rem 0 2rem;
/* Change display to CSS Grid layout with 2 columns that autofill */
display: grid;
grid-template-columns: repeat(auto-fill, minmax(50%, 1fr));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this removal? What's the look you're aiming for?

Copy link
Contributor Author

@ritorhymes ritorhymes Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My intention was to keep the same original visual intent and structure for the CTA image layout but remove the noticeable offset preventing them from being properly centered on mobile (like it is already on desktop).

This code block was having unintended side-effects given the system's structure, removing it was key.

The padding, even though its values were set to be evenly distributed, was causing the images to be offset on mobile, and removing it in this setup did not have an impact on the desktop layout.

The grid was also unnecessary, upon removing it with the current setup, the image layout is the same as it was, but without the offset on mobile. Adding it back in for my build actually breaks the page, but finding a way to put it in at this point wouldn't make sense when the setup I have creates the same layout for the images as it originally was on all breakpoints. So there's no justification for keeping it (or restoring it from my branch) when it isn't actually adding any meaningful structure and only risks complicating and/or breaking the layout.

The outcome is that the image layout should look pretty much the same on desktop and mobile as it already did but without any offset throwing the centering off.

@ritorhymes ritorhymes force-pushed the fix/training-mobile-layout branch 2 times, most recently from f4ab682 to 624c727 Compare September 22, 2025 08:23
- Centered CTA text and images

- Expanded CTA text width for better readability

- Centered iframe logo grid
@ritorhymes ritorhymes force-pushed the fix/training-mobile-layout branch from 624c727 to 00a5512 Compare September 22, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants