- From: Claudia Meadows via GitHub <sysbot+gh@w3.org>
- Date: Tue, 11 Feb 2025 23:09:04 +0000
- To: public-css-archive@w3.org
I have a better suggestion, one that better integrates with how it's actually done in practice: add CSS properties for significant whitespace control. - `white-space-before-start: trim | retain` - `white-space-after-start: trim | retain` - `white-space-before-end: trim | retain` - `white-space-after-end: trim | retain` In each of these, `retain` retains the space, and `trim` trims it. And of course, three shorthand properties: - `white-space-inside: <after-start> <before-end>` - `white-space-outside: <before-start> <after-end>` - `white-space-control: <inside> <outside>` In all three, they can accept up to two, but if you only pass one, it intelligently applies to both. For an easier time with HTML, especially with minifiers and formatters, add `trim` and `notrim` global token list attributes to do the same. This desired (partial) UA stylesheet below should explain how they work. ```css [trim~=before-start i] { white-space-before-start: trim; } [trim~=after-start i] { white-space-after-start: trim; } [trim~=before-end i] { white-space-before-end: trim; } [trim~=after-end i] { white-space-after-end: trim; } [trim~=inside i] { white-space-inside: trim; } [trim~=outside i] { white-space-outside: trim; } [trim~=both i], [trim=""] { white-space-control: trim; } [notrim~=before-start i] { white-space-before-start: retain; } [notrim~=after-start i] { white-space-after-start: retain; } [notrim~=before-end i] { white-space-before-end: retain; } [notrim~=after-end i] { white-space-after-end: retain; } [notrim~=inside i] { white-space-inside: retain; } [notrim~=outside i] { white-space-outside: retain; } [notrim~=both i], [notrim=""] { white-space-control: retain; } ``` -- GitHub Notification of comment by dead-claudia Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10821#issuecomment-2652266618 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 11 February 2025 23:09:05 UTC