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

Improve line wrapping in code blocks #27

Open
WilcoFiers opened this issue May 4, 2023 · 0 comments
Open

Improve line wrapping in code blocks #27

WilcoFiers opened this issue May 4, 2023 · 0 comments

Comments

@WilcoFiers
Copy link
Member

We use a tool called prettier to format our code blocks. This sets a certain line length which is longer than the maximum line length of code blocks on the WAI website. Because of that we get odd wrapping of code, which is especially notable on examples that have longer text sections. Here's an example:

https://www.w3.org/WAI/standards-guidelines/act/rules/2eb176/proposed/#failed-example-2
Failed example 2 line wrapping

We could adjust line wrapping to match what's the maximum width supported on the WAI website. That would improve this on wider screens. That makes line wrapping better for most people, but then on smaller / magnified screens the problem isn't solved. For that the only thing I can think of is to actually load a code formatter into the page and adjust spacing dynamically. That's not ideal... and perhaps there are better ways to solve this that can do this with CSS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant