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

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

From: Marat Tanalin | tanalin.com <mtanalin@yandex.ru>
Date: Thu, 19 Jan 2012 21:51:48 +0400
To: Tab Atkins Jr. <jackalmage@gmail.com>
Cc: Brad Kemper <brad.kemper@gmail.com>,John Daggett <jdaggett@mozilla.com>,Matthew Wilcox <elvendil@gmail.com>,www-style@w3.org,ACJ <ego@acjs.net>
Message-Id: <748711326995508@web14.yandex.ru>
19.01.2012, 21:44, "Tab Atkins Jr." <jackalmage@gmail.com>:
> 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

Just thoughts: maybe background-image[4] (looks more array-like)? Is there a draft for accessing individual items of CSS enumerations such as in multiple bg-layers case?

Received on Thursday, 19 January 2012 17:52:27 UTC

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