riptano / docs-ui

The UI and theme for DataStax Docs.
https://riptano.github.io/docs-ui/
Mozilla Public License 2.0
2 stars 0 forks source link

Don't break/wrap in the middle of a word #156

Open aimurphy opened 3 months ago

aimurphy commented 3 months ago

I can't remember where/if I filed an issue for this already, but the mid-word line breaks are hard to read and potentially error-causing, especially when it happens with code. For example, in this table someone could misunderstand the hyphens as part of the parameter names:

image

I tested if this was a viewport issue, and it is not. Even at max width, it still does this.

image

eric-schneider commented 3 months ago

@aimurphy are you specifically talking about wrapping within tables, or do you you think we should turn off wrapping everywhere? Tables definitely introduce a lot of strict space constraints that can be tricky to accommodate. You can make the text monospace to prevent the hyphens from showing up, but it will still wrap aggressively in a table like this.

aimurphy commented 3 months ago

I think we should turn off mid-word wrap everywhere. It's just hard to read and there are various ways it could cause complications. Code strings are one example, but also words like "invalid", where "in" is on one line and "valid" starts on the next line, could be misread as valid, etc.

I know some wrapping is inevitable, but the mid-word break is usually not necessary, and in some cases it even seem excessive.

In the case of that table, I would expect the code string to break/wrap at the _ without a hyphen.

aimurphy commented 3 months ago

Here are some more examples where the mid-word breaking is just going overboard:

image

image

image

image