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

40em rule considered harmful (was is this spacing intentional?) #4958

Open
sparkiegeek opened this issue Jan 29, 2024 · 4 comments
Open

40em rule considered harmful (was is this spacing intentional?) #4958

sparkiegeek opened this issue Jan 29, 2024 · 4 comments
Assignees

Comments

@sparkiegeek
Copy link
Contributor

          Is this spacing intentional?

image

Notice how the content (the <p>) is width constrained (seemingly due to a CSS rule of max-width: 40em) whilst the header and the tab bar are "full width"

Originally posted by @sparkiegeek in canonical/maas.io#815 (comment)

@bartaz
Copy link
Contributor

bartaz commented Jan 29, 2024

All text elements should have the same max width, including heading. I'm not sure what styles cause headings to have full width in this case.

What's the page this comes from? I can't find it. On live it seems to look like this which fine?

image

@bartaz
Copy link
Contributor

bartaz commented Jan 29, 2024

@lyubomir-popov

Are headings supposed to have max-width of 40em (relative to their own font size) or 40rem relative to document font (to keep their width the same as paragraphs)?

With current implementation of 40em this leads to situations when headings can be significantly wider than the text below them:

image

@lyubomir-popov
Copy link
Contributor

The purpouse of the max-width is to limit the number of characters per line to about 90 (used to be 75, which is the typographic best practice). That's why font-size relative max-width makes most sense. Maybe even a ch css unit directly set to 90 for all elements might make more sense? (not sure if that accounts for monospaced vs normal fonts)

@lyubomir-popov
Copy link
Contributor

Worth noting, this is a falesafe - so no text can become longer than 90 chars give or take, at which point it becomes difficult to read. It's the layout's job to create further limiting factors if needed.

In this case, I think it's ok to have headings use the available space, as it creates denser documentation (fewer wrappings and lines overall), which if I understand correctly is very valuable to the docs team.

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

3 participants