Skip to content

fix: add horizontal scroll to code blocks on narrow viewports (#1350)#1355

Open
Pcmhacker-piro wants to merge 2 commits into
SAPTARSHI-coder:mainfrom
Pcmhacker-piro:fix/docs-code-overflow-1350
Open

fix: add horizontal scroll to code blocks on narrow viewports (#1350)#1355
Pcmhacker-piro wants to merge 2 commits into
SAPTARSHI-coder:mainfrom
Pcmhacker-piro:fix/docs-code-overflow-1350

Conversation

@Pcmhacker-piro
Copy link
Copy Markdown

Closes #1350

Pull Request Description

Code example blocks in the documentation site overflow horizontally on narrow viewports (< 640px) without any scrollbar, making the right portion of code unreadable on mobile devices.


Type of Change

  • ✨ New animation / hover effect
  • 🧩 New component
  • 📝 Documentation improvement
  • 🐛 Bug fix in an existing submission
  • Other (describe below)

Submission Checklist

  • All changes are inside submissions/examples/your-feature-name/
  • Includes demo.html — self-contained, opens in browser with no server
  • Includes style.css — raw CSS for the proposed feature
  • Includes README.md — what it does, how to use it, why it fits EaseMotion CSS
  • No changes to core/
  • No changes to components/
  • One feature per PR (no bundled unrelated changes)

Feature Description

What does this add?

Adds overflow-x: auto and max-width: 100% to .docs-code pre so code blocks get their own horizontal scrollbar when content overflows, preventing page-level horizontal scroll on mobile.

How does a developer use it?

No usage change — scrollbars appear automatically inside code blocks when needed.

<!-- Works with any existing code block in the docs -->
<div class="docs-code">
  <pre><code>npm install easemotion-css</code></pre>
</div>
Why does it fit EaseMotion CSS?
Documentation should be usable on all screen sizes, matching the framework's developer-friendly philosophy.
Demo
- Demo added (demo.html works by opening directly in a browser)
Browser Testing
- Chrome
- Firefox
- Edge
- Safari (optional but appreciated)
Notes for Maintainer
Also added -webkit-overflow-scrolling: touch for smooth momentum scrolling on iOS. Only docs/index.html was changed — 3 lines added to the existing .docs-code pre rule.
Closes #1350

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jun 4, 2026
@Pcmhacker-piro
Copy link
Copy Markdown
Author

heyy @SAPTARSHI-coder
i fixed the assign issue so pls check this

- Fix duplicate id="variables" (second section renamed to id="custom-properties")
- Fix duplicate id="animations" (second section renamed to id="animations-reference")
- Fix unclosed <pre><code> tag in delay helpers example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

## Bug: Documentation code example blocks overflow horizontally on narrow viewports

1 participant