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

Re: [css3-fonts] Re: Adding something to the current stack (smarter fallbacks)

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 19 Jan 2012 09:44:45 -0800
Message-ID: <CAAWBYDBjSHsWrn5uUs7dNTrjm91sb2=kY-N3oy=VW50L3940kA@mail.gmail.com>
To: Brad Kemper <brad.kemper@gmail.com>
Cc: John Daggett <jdaggett@mozilla.com>, Matthew Wilcox <elvendil@gmail.com>, www-style@w3.org, ACJ <ego@acjs.net>
On Thu, Jan 19, 2012 at 8:58 AM, Brad Kemper <brad.kemper@gmail.com> wrote:
> On Jan 11, 2012, at 8:12 PM, John Daggett wrote:
>> I think the right way to simplify this is with some form of variable
>> substitution.
>> For example:
>> @font-stack {
>>  name: FallbackStack;
>>  font-family: MelbourneRegular, "Helvetica Neue", Helvetica, Arial, sans-serif;
>> }
>> #special { font-family: LeagueGothicRegular, FallbackStack; }
>> The substitution would occur at parse time and would only be expanded
>> within font or font-family property values (thus avoiding issues like
>> nested definitions).
>> I'm dubious of generalized list morphing super-syntax, that seems like
>> complete overkill in this particular case.
> The generalized list morphing super-syntax would be useful in other places too, especially for multiple backgrounds. Throw gradients (which have their own lists) into multiple background layers, and you can have huge background declarations that would have to be repeated every time you wanted to change a layer (well, especially if changing the background-image in that case).
> I would love to be able to do this:
> background-image: , , , url(whatever.png), *
> ...where each comma meant "keep previously cascaded values for that layer, and where the final ", *" meant "also keep any previously cascaded values for layers that come after this position". So that in the example,  the new image would be added to the fourth layer, regardless of how many layers there are (if less than four, then the first three layers are invisible).

This could also be addressed by something like:

background-image-4: url(whatever.png);

That seems somewhat easier to read - it's difficult to tell off-hand
what layer is being referenced in your example.

Received on Thursday, 19 January 2012 17:45:37 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:10 UTC