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

Re: [css-values-4] String concatenation

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 22 Jul 2014 14:14:51 -0700
Message-ID: <CAAWBYDCDOTj-ji9tA7xs+s2iay+Tp9N=gA6eJSniYG++E8iFXA@mail.gmail.com>
To: François REMY <francois.remy.dev@outlook.com>
Cc: Christoph Päper <christoph.paeper@crissov.de>, www-style list <www-style@w3.org>
On Tue, Jul 22, 2014 at 9:47 AM, François REMY
<francois.remy.dev@outlook.com> wrote:
>> IIRC, back when ‘calc()’ was being proposed
>> someone suggested to use some kind of
>> brackets, ‘(’/‘)’ or ‘{’/’}’ or ‘[’/‘]’ or ‘<’/‘>’, to
>> establish a special context inside values
>> wherein the usual symbols ‘+’, ‘-’, ‘*’ and
>> ‘/’ could be used to combine values.
>>
>> The plus sign could have been used with
>> length and string values differently.
>
>
> We can however do the exact same thing within "calc".
>
>    calc("a" + "b") // "ab"
>
> But it means that calc() may end up having different types depending on its
> content (albeit it is possible to know it at parse time)

Already completely true - calc() can represent a <number>, an
<integer>, a <length>, etc depending on its contents.

~TJ
Received on Tuesday, 22 July 2014 21:15:43 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:23 UTC