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

[css-text] Prevent pre from inheriting hanging-punctuation by default with a user-agent style rule #9689

Closed
AmeliaBR opened this issue Dec 8, 2023 · 1 comment

Comments

@AmeliaBR
Copy link
Contributor

AmeliaBR commented Dec 8, 2023

See this post from Tony Mottaz, where there is currently non-interoperable behaviour about whether hanging-punctuation styles inherit into pre-formatted text blocks.

I would recommend adding pre { hanging-punctuation: none; } to the user agent stylesheet (assuming the HTML folks are OK with that). Authors can override if they need to, but I think the more common situation is to want to add typographic niceties to body text but keep text columns neatly monospaced for pre-formatted blocks!

Another option (and this may be how other browsers have implemented it) is to make hanging-punctuation have no effect in a preserved whitespace context. But that removes the author choice.

Either way, the sooner this change is made, the better, just in case there's anyone out there who does like their code braces hanging off the sides of their code block & they get used to the current behaviour.

@AmeliaBR AmeliaBR added css-text-4 HTML Requires coordination with HTML people labels Dec 8, 2023
@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-text] Prevent `pre` from inheriting hanging-punctuation by default with a user-agent style rule, and agreed to the following:

  • RESOLVED: Define that hanging punctuation is set to none for pre elements in the user agent style sheet
The full IRC log of that discussion <fantasai> +1
<frances> Alan: commment about prevent inheriting by default for hanging punctuation in code
<jfkthame> +1
<frances> Florian: No strong opinion, raised by Amelia, she recommends non in user recommended style sheet or have no effect in a preserved space context, not sure to have having punctuation by default, might be nonsensical
<frances> Elika, Amelia, and Alan: agreed
<frances> Alan: is there anything else that doesn't make sense in a preformatting context?
<florian> s/recommends non/recommends none
<florian> s/recommended style sheet/style sheet
<frances> Eric: Thinking table cells, less clear than the precase, would it hang over the edge in the table cell
<frances> Alan: depends on margins and padding, not as clear cut
<frances> PROPOSAL: Define that hanging punctuation is set to none for pre elements in the user agent style sheet
<frances> Alan: any objections?
<frances> fantasai: Spec it first, make an HTML pr, has a default set of styles
<fantasai> https://www.w3.org/TR/css-text-3/#default-stylesheet
<frances> Alan: might be easier for html people to take things one by one
<frances> RESOLVED: Define that hanging punctuation is set to none for pre elements in the user agent style sheet

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

4 participants