You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-text] Prevent pre from inheriting hanging-punctuation by default with a user-agent style rule #9689
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.
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
Activity
css-meeting-bot commentedon Jan 10, 2024
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 sheetThe 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
[css-text-4] Don't let hanging-punctuation inherit into pre elements