nodejs.org icon indicating copy to clipboard operation
nodejs.org copied to clipboard

fix: layout word break

Open araujogui opened this issue 9 months ago • 8 comments

Description

Change layout's word break to normal

Validation

image

Related Issues

Fixes #6711

Check List

  • [x] I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • [x] I have run npm run format to ensure the code follows the style guide.
  • [x] I have run npm run test to check if all tests are passing.
  • [x] I have run npx turbo build to check if the website builds without errors.
  • [x] I've covered new added functionality with unit tests if necessary.

araujogui avatar May 05 '24 16:05 araujogui

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview May 7, 2024 9:47am

vercel[bot] avatar May 05 '24 16:05 vercel[bot]

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 98 🟢 100 🟢 100 🟢 91 🔗
/en/about 🟢 99 🟢 100 🟢 96 🟢 91 🔗
/en/about/previous-releases 🟢 98 🟢 100 🟢 100 🟢 92 🔗
/en/download 🟢 98 🟢 100 🟢 100 🟢 91 🔗
/en/blog 🟢 99 🟢 100 🟢 100 🟢 92 🔗

github-actions[bot] avatar May 06 '24 04:05 github-actions[bot]

Unit Test Coverage Report

Lines Statements Branches Functions
Coverage: 91%
90.04% (588/653) 76.08% (175/230) 92.18% (118/128)

Unit Test Report

Tests Skipped Failures Errors Time
128 0 :zzz: 0 :x: 0 :fire: 6.004s :stopwatch:

github-actions[bot] avatar May 06 '24 04:05 github-actions[bot]

It seems to overflow content for low-resolution mobile browsers, for example;

https://nodejs-jow7mncue-openjs.vercel.app/en/blog/release/v20.12.0

IMO it might be better to use xs:break-words for mobile resolution

canerakdas avatar May 06 '24 12:05 canerakdas

yeah - we have dueling solutions here now and we need to slow down and consider our use cases and options

bmuenzenmeyer avatar May 06 '24 19:05 bmuenzenmeyer

You guys may consider text-align: justify: image

NiedziolkaMichal avatar May 07 '24 18:05 NiedziolkaMichal

I would suggest try

word-break: normal;
overflow-wrap: anywhere;
hyphens: auto;

This will both keep the result closest to the current design and bring hyphens to broken words at the end of the lines.

Another benefit would be that we don't need to concern media query for such cases further.

krave1986 avatar May 08 '24 04:05 krave1986

Look we also already tried the hyphens approach. Each approach has its own cons and pros and different side effects.

I think is worth going over git history to see what was already attempted and what not and if whatever proposed works well on all scenarios

ovflowd avatar May 08 '24 05:05 ovflowd

I came across this PR after running into this odd issue and trying to fix it myself. For me, personally, justified alignment and normal word break work fine in combination.

tniessen avatar May 10 '24 08:05 tniessen

@araujogui could you go over the considerations that both me, Caner and Brian mentioned? 👀

ovflowd avatar May 10 '24 08:05 ovflowd

Found out that word-break was introduced in #6680, so I think we can assume that until then it was the browsers defaults (normal). The issue solved in #6680 didn't come back with this PR.

araujogui avatar May 16 '24 23:05 araujogui