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

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.

~TJ

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