W3C home > Mailing lists > Public > www-style@w3.org > November 2015

[css-scoping] Scoping @font-face defined in shadow DOM

From: Ryosuke Niwa <rniwa@apple.com>
Date: Mon, 09 Nov 2015 16:55:52 -0800
Message-id: <E26CB008-1563-430F-9647-9F703A3D9441@apple.com>
To: www-style list <www-style@w3.org>

We would like to make a declaration of @font-face scoped to the shadow DOM in which it is defined and have a higher precedence over @font-face defined outside the shadow DOM.

While not ideal, we think it's okay to let @font-face defined outside the shadow DOM to bleed into the shadow DOM since that is needed to support the common scenario of matching the style outside the shadow DOM.  We can solve this problem in the future by providing a mechanism to hide @font-face.

On the other hand, @font-face inside a shadow DOM overriding @font-face outside the shadow DOM will break one major feature of shadow DOM: style rules in a shadow DOM do not affect nodes outside the shadow DOM.  In particular, @font-face defined in one shadow DOM should not affect fonts used in another shadow DOM.

In addition, we think using a specific font is necessary for some components to function properly (e.g. for emojis, icons, mathematical symbols, etc...) just like some components need to use !important rules to force a certain style to function properly.

- R. Niwa
Received on Tuesday, 10 November 2015 00:56:29 UTC

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