W3C home > Mailing lists > Public > www-style@w3.org > July 2013

[css-selectors] Selecting non-element nodes

From: François REMY <francois.remy.dev@outlook.com>
Date: Thu, 25 Jul 2013 20:13:09 +0200
Message-ID: <DUB120-W195965E49D4F85B1436F28A5690@phx.gbl>
To: "www-style@w3.org" <www-style@w3.org>
For some time already, people advocated for a way to select text nodes using CSS. 
   :node-type(x) pseudo-class, whose absence implies the "element" type
   { other values includes "all", "text", "comments"... }
   multiple comma-separated arguments are allowed and allows to create union sets
Use cases include:
- flowing text nodes into a css-region-flow while keeping some siblings out of the flow
    .to-flow-into> *:node-type(all) { flow-into: x }
    .to-flow-into> .not-in-flow { flow-into: none }
- hiding text-nodes as part of the continuing content of a document
    .read-more ~ *:node-type(all) {display:none})
- coloring them without affecting the other elements inherited color value
    .local-blue> *:node-type(text) { color: blue }

Received on Thursday, 25 July 2013 18:13:35 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:32 UTC