Skip to content
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

Force wrap long text #2431

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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/quick-countries-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-react': patch
---

Force text wrapping for long words. Affected components: `Text`, `NonIdealState`, `Stepper`, `WorkflowDiagram`.
5 changes: 5 additions & 0 deletions .changeset/stupid-radios-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-css': patch
---

Force text wrapping for long words in typography components (`iui-text-…`) and a few other text instances in other components (e.g. `iui-non-ideal-state-title`, `iui-stepper-step`, `iui-workflow-diagram-step`, etc.).
1 change: 1 addition & 0 deletions packages/itwinui-css/src/text/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@
$type: if(map.has-key($sizes, $type), $type, body);
font-size: map.get($sizes, $type);
font-weight: map.get($weights, $type);
overflow-wrap: anywhere;
Copy link
Contributor

@mayank99 mayank99 Feb 13, 2025

Choose a reason for hiding this comment

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

Does word-break: break-word + hyphens: auto work instead of overflow-wrap: anywhere? I think that would be safer / have fewer undesirable results.

Edit: Actually, word-break: break-word is just an alias for overflow-wrap: anywhere. So hyphens: auto is the only important part of my comment.

Suggested change
overflow-wrap: anywhere;
overflow-wrap: anywhere;
hyphens: auto;

}