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

Re: [css-values-4] String concatenation

From: Lea Verou <lea@verou.me>
Date: Sun, 20 Jul 2014 23:07:46 +0300
Cc: François REMY <francois.remy.dev@outlook.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, www-style list <www-style@w3.org>
Message-Id: <AE7BFA3A-E1C7-416B-B30C-C67F677C07EF@verou.me>
To: Sylvain Galineau <galineau@adobe.com>
On Jul 19, 2014, at 22:14, Sylvain Galineau <galineau@adobe.com> wrote:

> The decision and the design should be based on use-cases; in the quoted IRC thread Lea mentions using attr() in url() being useful for things like data URIs. Lea, can you elaborate on what you had in mind?

I often use lightly urlencoded SVG data URIs in CSS, especially for my book (since there filesize doesn't matter) and it would be very useful to be able to apply the same parameterized data URI to various elements, only changing an attribute on the element, or a CSS variable. For example (not super common, but recent, so it comes to mind first), an SVG file that creates simple pie charts, using attr(data-value) in stroke-dasharray for the percentage. Then, one could make pie charts with things like <div data-value=".5">50%</div>.

Marat also mentioned a very common use case, even though his specific example is not great. But synthesizing image URLs from attributes, variables, even counters is something I expect to be incredibly common once this is allowed & widely implemented.

Received on Sunday, 20 July 2014 20:08:13 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:42 UTC