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

> On Nov 11, 2015, at 1:51 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> 
> This doesn't address the other issue that I haven't been able to solve
> yet, which is font names inheriting down into a shadow where the font
> name is defined to be something else entirely.  That is:
> 
> <style>
> @font-face { font-family: foo; src: local("helvetica"); }
> body { font-family: foo; }
> </style>
> <custom-el>
>  <::shadow>
>    <style>
>    @font-face { font-family: foo; src: local("comic sans"); }
>    h1 { font-family: foo; }
>    </style>
>    <h1>Comic sans heading, yay!</h1>
>    <p>Whoops, Comic Sans body text.</p>
>  </::shadow>
> </custom-el>
> 
> There's no way in the current system to make sure that the *inherited*
> foo font refers to the outer face, but the specified one on the
> heading refers to the inner face.

Do you have any evidence indicating that this is a common scenario?

If this was an issue, then passing a CSS variable through a shadow boundary is similarly problematic. Consider:

<style>
body { --foo: blue; color: var(--foo); }
</style>
<custom-el>
 <::shadow>
   <style>
   div { --foo: red; }
   h1 { color: var(--foo); }
   </style>
   <div>
     <h1>Comic sans heading, yay!</h1>
     <p>Whoops, Comic Sans body text.</p>
   </div>
 </::shadow>
</custom-el>

- R. Niwa

Received on Wednesday, 11 November 2015 22:32:49 UTC