Skip to content

fix(CodeExample): polish layout for narrow viewports - #1

Open
emmyafolly123-coder wants to merge 1 commit into
mainfrom
polish/ce-mobile-31-vport
Open

fix(CodeExample): polish layout for narrow viewports#1
emmyafolly123-coder wants to merge 1 commit into
mainfrom
polish/ce-mobile-31-vport

Conversation

@emmyafolly123-coder

Copy link
Copy Markdown
Owner

Overview

This PR polishes the CodeExample component layout for narrow (mobile) viewports, improving wrapping behavior, touch target sizes, and overall readability at ≤375px and ≤480px widths.

Related Issue

Closes CalloraOrg#546

Changes

  • [MODIFY] src/styles/code.css - Added responsive breakpoints for narrow (≤480px) and extra-narrow (≤375px) viewports; header stacks vertically, tabs scroll horizontally, touch targets meet 44px minimum; reduced-motion support
  • [MODIFY] src/components/CodeExample.tsx - Replaced inline header styles with BEM class .code-sample__header for proper responsive behavior
  • [MODIFY] src/components/CodeExample.test.tsx - Added narrow viewport tests for BEM class presence
  • [MODIFY] src/print.test.ts - Updated regex to match className with multiple classes

Verification Results

npm test
✅ 894/894 tests pass (2 pre-existing failures unrelated to this change)

Acceptance Criteria

Status Criterion
CodeExample header stacks vertically at narrow widths (≤480px)
Tabs are horizontally scrollable on small screens
Copy button has 44px minimum touch target height for mobile accessibility
Code text remains readable with appropriate font sizing
All existing tests pass

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.

Polish CodeExample layout for narrow (mobile) viewports

1 participant