W3C home > Mailing lists > Public > www-style@w3.org > March 2012

[css4-values] Templated URLs

From: fantasai <fantasai.lists@inkedblade.net>
Date: Tue, 20 Mar 2012 16:20:25 -0700
Message-ID: <4F6910B9.5000506@inkedblade.net>
To: "www-style@w3.org" <www-style@w3.org>
I received a suggestion[1] from Maxime Thirouin [1] for templating URLs with the following example. [2]
Forwarding here for archival / discussion.

~fantasai

[1] https://twitter.com/MoOx/status/173093535275421697
[2] http://dabblet.com/gist/1753404

/**
  * Gravatar without <img> tag
  *
  * @memo 
https://secure.gravatar.com/avatar/36d07341931078d5125fa99397a34ed8?s=140&d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png
  *
  * @todo make this doable with a javascript
  * @link http://darcyclarke.me/development/quick-tip-get-gravatar-images-from-emails-with-javascript/
  */

[data-gravatar-uri]::after
{
     content: url(attr(data-gravatar-uri)); /* impossible */
}

[data-email-md5]::after
{
     content: url("http://www.gravatar.com/avatar/" attr(data-email-md5) "?s=100"); /* more impossible */
}


[data-email-md5][data-gravatar-size]::after
{
     content: url("http://www.gravatar.com/avatar/" attr(data-email-md5) "?s=" attr(data-gravatar-size) ); /* more & more 
impossible */
}
Received on Tuesday, 20 March 2012 23:20:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:48:53 GMT