Skip to content

fix(a11y): prevent carousel caption text truncation at high zoom#397

Merged
WanjohiSammy merged 1 commit into
masterfrom
a11y/carousel-caption-reflow
Jun 15, 2026
Merged

fix(a11y): prevent carousel caption text truncation at high zoom#397
WanjohiSammy merged 1 commit into
masterfrom
a11y/carousel-caption-reflow

Conversation

@WanjohiSammy

@WanjohiSammy WanjohiSammy commented Jun 15, 2026

Copy link
Copy Markdown
Member

Problem

At 400% zoom the "Recent Posts" carousel slide grows taller than its background image and is clipped by .carousel-inner { overflow: hidden }, truncating the caption text (WCAG 1.4.10 Reflow).

Where the issue is

The homepage carousel "Recent Posts" slide at 400% page zoom.

Solution

Below Bootstrap's md breakpoint (<=991px), let the caption flow in normal document flow (position: static, no negative margins, no max-height) so the carousel container grows to fit it. The >=992px desktop overlay is unchanged.

Where in code

  • public/css/site.css - new @media (max-width: 991px) block overriding .carousel-caption.

Validated against WCAG 2.1 AA (keyboard, screen reader, and 400% zoom where applicable).

Before at 400% zoom

image

After at 400% zoom

image

The home page carousel caption is position:absolute, so it does not
contribute to the carousel height; the carousel height comes from the
image. At high zoom the "Recent Posts" slide (heading + four stacked
post columns) grows taller than the image and is clipped by
.carousel-inner{overflow:hidden}, truncating the text.

Below Bootstrap's md breakpoint (<=991px, which includes 400% zoom of a
1280px viewport per WCAG 1.4.10 Reflow) the post columns stack, so make
the caption flow in normal document flow (position:static, no negative
margins, no max-height). The carousel container then grows to fit the
caption and nothing is clipped. The >=992px desktop overlay is
unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an accessibility issue on the homepage “Recent Posts” carousel where caption text is clipped/truncated at high zoom due to the caption being an absolutely positioned overlay inside an overflow: hidden carousel container.

Changes:

  • Adds a <992px media query to make .carousel-caption participate in normal document flow (position: static) so the slide can grow vertically.
  • Removes constraining/offsetting styles for the caption at that breakpoint (margins and max dimensions), preserving the desktop overlay behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@WanjohiSammy WanjohiSammy merged commit 4111648 into master Jun 15, 2026
2 checks passed
@WanjohiSammy WanjohiSammy deleted the a11y/carousel-caption-reflow branch June 15, 2026 21:56
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.

3 participants