Skip to content

Fix for overflow scrolling issue #2275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/smart-memes-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cloudfour/patterns': patch
---

Prevent visually-hidden language labels from breaking width of overflowing code blocks
7 changes: 5 additions & 2 deletions src/base/_defaults.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ audio {
* Code blocks
*
* 1. Don't allow code blocks to overflow willy-nilly.
* 2. Set a shallower tab size to encourage accessible code samples without
* 2. Prevent absolute-positioned children (such as visually-hidden language
* labels) from breaking horizontal scroll in Chrome.
* 3. Set a shallower tab size to encourage accessible code samples without
* compromising horizontal real estate.
*/

Expand All @@ -145,7 +147,8 @@ pre {
color: color.$text-light;
overflow: auto; /* 1 */
padding: ms.step(1);
tab-size: 2; /* 2 */
position: relative; /* 2 */
tab-size: 2; /* 3 */
}

/**
Expand Down