[csswg-drafts] [css-values] String concatentation

LeaVerou has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [css-values] String concatentation ==
As discussed with @tabatkins during TPAC last week.

Now with variables (custom properties), string concatenation is coming
 up in more and more use cases. Constructing URLs from variables for 
instance (see #541) is useless without concatenation.
Also, building SVG paths from variables.

Tab suggested a `concat()` function. I wonder if we can reuse the 
syntax from `content` which already allows for concatenation in a 
simple and elegant way, and special case the few cases where existing 
widely used property values accept `<string>+` (e.g. `quotes`) if they
 are sufficiently few and concatenation isn't needed there. Sure, it's
 weird if concatenation doesn't work in a few places, but I think the 
usability benefits of doing concatenation in the same simple way that 
authors are already used to, are worth it. Otherwise, CSS will end up 
like LISP with all the parentheses (imagine things like 
`concat(var(--text), calc(1% * var(--foo)))`, which will be pretty 
common).

Related specs:
* https://www.w3.org/TR/css-values/
* https://www.w3.org/TR/css-variables/

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/542 using your GitHub 
account

Received on Wednesday, 28 September 2016 16:04:18 UTC