[css-values] text()

Hi all,

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.

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/

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.

[1]
http://stackoverflow.com/questions/7175113/content-attribute-to-inherit-node-value
[2]
http://blog.adrianroselli.com/2012/10/chromatic-type-with-pseudo-elements.html
[3] http://www.dynamicdrive.com/style/csslibrary/item/rollover_text_menu/

Thanks,
Jon

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