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

Re: [css-fonts] Does @font-face v. ruleset order matter?

From: Shawn Ligocki <sligocki@google.com>
Date: Wed, 24 Sep 2014 10:39:51 -0400
Message-ID: <CACNG_45hda1fYKoHA_6pZ18HQ7T-QnGhVvEmcRqbqGaciCXzxQ@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style <www-style@w3.org>
On Fri, Sep 19, 2014 at 1:33 PM, Tab Atkins Jr. <jackalmage@gmail.com>
wrote:

> On Fri, Sep 19, 2014 at 9:49 AM, Shawn Ligocki <sligocki@google.com>
> wrote:
> > I'm looking into adding @font-face parsing to our CSS parser and I'm
> trying
> > to figure out how to represent them. It would make it much simpler if all
> > the @font-face rules could be stored in a separate list from the
> rulesets.
> > But this would only be safe if the relative order doesn't matter between
> > @font-face rules and rulesets. Otherwise, we'd need to preserve the
> original
> > ordering.
> >
> > For example, are the following equivalent:
> >
> >   @font-face { ...1 }
> >   .a { ...2 }
> >   @font-face { ...3 }
> >   .b { ...4 }
> >
> > and
> >
> >   @font-face { ...1 }
> >   @font-face { ...3 }
> >   .a { ...2 }
> >   .b { ...4 }
> >
> > no matter what the ...s contain? Or could the .a being between the two
> > @font-faces cause the interpretation to differ? (Say only respect the
> font
> > from the first @font-face rule and not the second??)
>
> Relative ordering of @font-face and normal rules makes no difference
> to the use of those font faces; CSS is a properly declarative
> language, and doesn't have that sort of ordering dependence between
> resources and links.
>
> Since you don't care about preserving the overall stylesheet order,
> feel free to reorganize the @font-face rules, or stash them in a
> separate stylesheet.
>

Thanks Tab, this simplifies things a lot.

(And sorry about the double post, looks like moderation just posted my
original message)
Received on Wednesday, 24 September 2014 14:40:38 UTC

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