Skip to content

Commit b7f0107

Browse files
authored
fix: overflow with long words (#1215)
This PR aims to solve this problem globally rather than just in the 1 instance spotted as I suspect this is happen frequently with translations. - Add `hyphen: auto` globally (with exceptions) - Progresively enchance with `hyphen-limit-chars` to avoid over hyphenating (https://developer.mozilla.org/en-US/docs/Web/CSS/hyphenate-limit-chars) - Soft hyphens `\u00AD` can be used by the translation team to encourage preferred hyphenations (https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens) - Excludes elements that commonly avoid hyphenation (https://meyerweb.com/eric/thoughts/2012/12/17/where-to-avoid-css-hyphenation/)
1 parent b9481df commit b7f0107

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1212
- Styling issue on status bar on mobile (#1217)
1313
- Change tab `block-size` to `min-block-size` to allow for height increase when text wraps (#1219)
1414
- Changed `SkulptRunner.jsx` implementation of hiding elements to use `display: none` rather than `block-size: 0` (#1219)
15+
- Enabled `hyphens: auto` globally (with exceptions) to prevent overflow with longer words (#1215)
1516

1617
## [0.30.1] - 2025-06-09
1718

src/assets/stylesheets/InternalStyles.scss

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,28 @@
5858
display: flex;
5959
flex-flow: column;
6060
block-size: 100%;
61+
hyphens: auto;
62+
hyphenate-limit-chars: 10 4 4; // Minimum of 10 characters before hyphenating, minimum of 4 character before and after the hyphen.
6163

6264
.proj {
6365
min-block-size: 100%;
6466
}
67+
68+
code,
69+
var,
70+
kbd,
71+
samp,
72+
tt,
73+
dir,
74+
listing,
75+
plaintext,
76+
xmp,
77+
abbr,
78+
acronym,
79+
blockquote,
80+
q {
81+
hyphens: none;
82+
}
6583
}
6684

6785
code {
@@ -91,7 +109,6 @@ button:focus-visible {
91109
}
92110
}
93111

94-
95112
.--light {
96113
--editor-color-layer-1: #{$rpf-teal-100};
97114
--editor-color-layer-2: #{$rpf-white};
@@ -120,5 +137,6 @@ button:focus-visible {
120137
--editor-color-tab-background: #{$rpf-grey-700};
121138

122139
.rpf-button--secondary {
123-
border-color: $rpf-navy-800;}
140+
border-color: $rpf-navy-800;
141+
}
124142
}

0 commit comments

Comments
 (0)