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

(Suggestion) word-break: break-all #121

Closed
fregante opened this issue Nov 29, 2016 · 14 comments
Closed

(Suggestion) word-break: break-all #121

fregante opened this issue Nov 29, 2016 · 14 comments

Comments

@fregante
Copy link

fregante commented Nov 29, 2016

word-break: break-all and overflow-wrap: break-word seem to only be suggested across internet as a solution to non-wrapping long words/URLs, which easily break flexible layouts.

... but I couldn't find any drawbacks on having this as default across the site. It doesn't sound like it would break anything (except, well, words) so what do you think about adding it to sanitize.css on html?

@fregante fregante closed this as completed Dec 6, 2016
@fregante fregante reopened this Jan 26, 2017
@DJTB
Copy link

DJTB commented Apr 11, 2017

FYI word-break does not have a break-word value it has break-all, only word-wrap/overflow-wrap has break-word.

Word-break with break-all is probably the better option overall.

@fregante fregante changed the title (Suggestion) word-break: break-word (Suggestion) word-break: break-all Apr 11, 2017
@fregante
Copy link
Author

Corrected, thanks

@jonathantneal
Copy link
Collaborator

Great! Let’s do some polling! https://twitter.com/jon_neal/status/851778801377955842

@jonathantneal
Copy link
Collaborator

@bfred-it, still interested in this?

@fregante
Copy link
Author

Yep!

@jonathantneal
Copy link
Collaborator

Going to add this as well.

@tomasz1986
Copy link

Please test this with tables because I do remember having issues related to this setting. I do not remember the details now though but I ultimately ended up reverting to the default browser behaviour.

@fregante
Copy link
Author

Table expand to fit the content, I can see how it would change its behavior. However, how does the table behave without it? It will overflow its set width, right?

@jonathantneal
Copy link
Collaborator

I will add this.

@jonathantneal
Copy link
Collaborator

Added in v6.0.0! 🎉

@fregante
Copy link
Author

I’m hopeful for a future where this doesn’t happen 🙂

a955ae5c-2629-4bae-9d24-a5e310f5d9f0

@jonathantneal
Copy link
Collaborator

Yes, this change would have fixed that 😛

By the way, the change wasn’t ultimately break-all, it was break-word.

@fregante
Copy link
Author

Yes perhaps break-word is a less aggressive default

@notiv-nt
Copy link

notiv-nt commented Jan 4, 2019

@jonathantneal @bfred-it take a look please.

The issue is closed but still relevant.

What about:

word-break: break-all; /* Firefox */
word-break: break-word; /* Chrome/Safari/Edge/IE9+ */

Or better solution:

Looks the same in all browsers.

word-break: break-word;
word-wrap: break-word;

It works https://jsbin.com/zinetit/edit?output

https://developer.mozilla.org/en-US/docs/Web/CSS/word-break#Browser_compatibility
https://github.com/csstools/sanitize.css/blob/master/sanitize.css#L60

Edge

image

Chrome/Safari/FF/IE9 (-grid / -flex)

image

@notiv-nt notiv-nt mentioned this issue May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants