W3C home > Mailing lists > Public > www-style@w3.org > September 2010

[css3-fonts] @font-face and !important

From: Rune Lillesveen <rune@opera.com>
Date: Tue, 14 Sep 2010 14:54:48 +0200
To: www-style@w3.org
Message-ID: <op.vi0wtm0a8isf1p@id-c1005.oslo.osa>

I was trying to figure out what to do about !important and properties of  
the @viewport rule. I checked how it's handled for @font-face descriptors.

The grammar of the CSS2 spec says the descriptors are parsed as  
declarations, and hence allow !important. The prose says "If a font  
descriptor is duplicated, the last occurring descriptor wins and the rest  
must be ignored.", but nothing about !important.

 From the latest editors draft of the CSS3 Fonts Module:

   "When a given descriptor occurs multiple times in a given @font-face  
rule, only the last specified value is used, all prior values for that  
descriptor are ignored."

I can't find anything about !important there.

I tried to search the www-style archive for "font-face !important", but  
didn't find any conclusions on the subject.

Tried this in Chrome, Firefox and Opera:

@font-face {
   font-family: "a" !important;
format('truetype') !important;
   font-family: "b";

div {
   font-family: "a";
   font-size: 100px;

All three browers find the descriptors valid, but Opera actually applies  
it naming the font-face "a" instead of "b".

Rune Lillesveen
Senior Core Developer / Architect
Opera Software ASA
Received on Tuesday, 14 September 2010 12:55:22 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:49:47 UTC