W3C home > Mailing lists > Public > www-style@w3.org > January 2010

Re: breaking overflow

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sat, 2 Jan 2010 23:52:02 -0600
Message-ID: <dd0fbad1001022152l3ca0d13eje5f91721cc67891e@mail.gmail.com>
To: Brad Kemper <brad.kemper@gmail.com>
Cc: www-style list <www-style@w3.org>
On Sat, Jan 2, 2010 at 11:19 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
> On Jan 2, 2010, at 7:01 PM, Tab Atkins Jr. wrote:
> On the other hand, if there was a pseudo-element to select a string of text wherever it occurred, then that would be powerful, and could also handle suppressing spaces. For instance, lets say you had something like this (with the optional second argument, "i", meaning "case insensitive"):
> p::text("bar",i) { font-weight: bold; }
> <p>Foo Bar Baz</p>
> Then "Bar" would be bold.

That suffers from the same problems that are currently keeping us from
putting ::selection in a draft: what precisely is the sane thing to do
when you have that selector and the code is <p>foo ba<i>r ba</i>z</p>?

> So to suppress spaces between each inline-block LI in a UL, you could just use this:
> ul::text(" ") { display: none; }
> li::text(" ") { display: inline; }
> This could be limited to text within the same text node, to avoid some of the problems with pseudo-elements like "::first-line".

Don't line breaks get normalized to spaces during the
whitespace-collapsing step?  In that case this code still wouldn't
work, as it'd miss those linebreaks.

Even if it did work, it's a pretty ugly solution imo to something
solved much more simply and elegantly with the white-space-collapse
property you pointed out.  Something like ::text certainly has some
uses I can think of, but I'd rather solve the issue of whitespace
handling more directly.

Received on Sunday, 3 January 2010 05:52:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:41 UTC