Skip to content

Fix tutorial layout#661

Merged
rafaelfranca merged 2 commits into
rails:mainfrom
ablzh:fix-tutorial-layout
May 15, 2026
Merged

Fix tutorial layout#661
rafaelfranca merged 2 commits into
rails:mainfrom
ablzh:fix-tutorial-layout

Conversation

@ablzh
Copy link
Copy Markdown
Contributor

@ablzh ablzh commented May 4, 2026

What changed

This PR fixes two layout bugs on the /docs/tutorials page:

  1. The "Advanced" section was overlapping onto the full-width "Beginner" card on intermediate screen widths (e.g., when viewing the site in a narrow browser window or split-screen mode). The content of the "Beginner" card grew taller than the container, causing the next section to render on top of it.
  2. After fixing the overlap, there was an unnaturally large gap between the "Beginner" and "Advanced" sections.

How it works

  1. Fixed CSS Specificity: The _docs.scss file contained a global max-height: 500px for .card__fullwidth .card that loaded after the mobile-specificmax-height: none styles in _cards.scss, trapping the content. I updated _docs.scss to only apply the 500px limit on viewports 768px and wider.
  2. Fixed Section Spacing: I removed the padfix class (an old CSS workaround) and the common-padding--bottom-small class from the first section's container. Removing the padding class removes the artificial 60px gap between the two sections, allowing them to flow with normal spacing while keeping their separate HTML containers intact.
Before_and_After Medium

ablzh added 2 commits May 4, 2026 14:54
The full-width cards on the tutorials page were overflowing and overlapping subsequent sections on mobile devices. This occurred because a hardcoded `max-height: 500px` in `_docs.scss` was overriding the intended mobile behavior due to CSS load order.

This limits the 500px `max-height` constraint to viewports 768px and wider, allowing the cards to expand naturally on smaller screens.
Fix section spacing and remove obsolete padfix class on tutorials page

After resolving the layout overlap issue on mobile, an unnaturally large gap remained between the "Beginner" and "Advanced" tutorial sections. This was cause by two overlapping padding classes on the first section's container:

1. `padfix`: An obsolete CSS hack that forcefully added 80px of bottom padding on mobile. This class and its CSS definitions have been completely removed.
2. `common-padding--bottom-small`: Added a standard 60px/40px bottom padding which was unnecessary since the sections are stacked.

Removing both classes from the "Beginner" container allows the sections to flo with normal spacing while keeping their separate HTML containers intact.
@rafaelfranca rafaelfranca merged commit 0788fed into rails:main May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants