Re: Adding a font to the current stack (smarter fallbacks)

Yes, that's a common problem. Filters suffer from the same issue. Transforms 
too. An idea would be to allow a new syntax that extends inherit. However, 
allowing "inherit" anywhere in a value is too complex, and it's a breaking 
change.

Two options comes in my mind:

(1) Use "inherit" as a special variable :

.translate100 { transform: translate(100,100), var(inherit); }
.zoom1 { transform: scale(1.1), var(inherit); }
// or whatever the variable syntax may be

(2) Use a special "inherit" function that can takes the place of any value :

.translate100 { transform: inherit(translate(100,100), ...); }
.zoom1 { transform: inherit(scale(1.1), ...); }
// or any symbol that could replace the ...





-----Message d'origine----- 
From: Charles Pritchard
Sent: Wednesday, January 11, 2012 9:23 PM
To: Tab Atkins Jr.
Cc: Matthew Wilcox ; www-style@w3.org
Subject: Re: Adding a font to the current stack (smarter fallbacks)

On 1/11/2012 9:41 AM, Tab Atkins Jr. wrote:
> On Wed, Jan 11, 2012 at 2:45 AM, Matthew Wilcox<elvendil@gmail.com> 
> wrote:
>> Can we get a way (or is there already a proposed way) to add a font on 
>> top
>> of an existing font stack?
>> It is tedious and a maintenance issue to have to re-declare entire font
>> stacks throughout a stylesheet just because I want to use a different 
>> font
>> on one particular element of the page.
>>
>> e.g.,
>>
>> html { font : 125%/1.3 MelbourneRegular, "Helvetica Neue", Helvetica, 
>> Arial,
>> sans-serif; }
>>
>> then later on I need to change a font for one particular paragraph and 
>> have
>> to write:
>>
>> #special {  font-family : LeagueGothicRegular, MelbourneRegular, 
>> "Helvetica
>> Neue", Helvetica, Arial, sans-serif;  }
>>
>> because if I were to write
>>
>> #special { font-family: LeagueGothicRegular; }
>>
>> It replaces the entire font stack instead of just attempting to load that
>> font, and if failing falling back to the inherited font-stack.
> This is a common problem for *all* list-valued properties in CSS;
> right now, they're always atomic, and you must re-specify the entire
> list if you want to change one part of it.
>
> We'd like to fix it, but no one's figured out how to do so yet.
> Suggestions welcome.  ^_^
>

Perhaps some special use of inherit?
#special { font-family: LeagueGothicRegular, inherit; } 

Received on Wednesday, 11 January 2012 21:36:59 UTC