Re: [css-values] text()

Jon Rimmer wrote:

 > I'd like to propose a text() function that returns an element's inner-text,
 > similarly to how attr() returns the value of an attribute.

Note that there already is a functional notation for getting the
textual content:

  http://www.w3.org/TR/css3-gcpm/#setting-named-strings-the-string-set-pro
  http://books.spec.whatwg.org/#named-strings

The use until now has been for running headers and footers.

 > The use-case for this is creating pseudo-elements that replicate the text
 > of the element for decorative purposes. For example, see the following list
 > of link effects:
 > 
 > http://tympanus.net/Development/CreativeLinkEffects/

Looks cool!

 > Most of the effects require the text of the link to be duplicated in a
 > data-hover attribute so it can be referenced via content: attr(data-hover).
 > This same technique can found in other places [1][2][3] but is hardly an
 > ideal practice, given the duplication of content it requires.

Certainly,

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome

Received on Saturday, 26 October 2013 18:12:01 UTC