'Using CSS in iframe / Adobe fonts

I am trying to use Adobe fonts in Wix.

As other posts have noted, you can't simply upload those fonts. Instead, you have to use a link tag in head (through Wix's custom CSS) to add an external stylesheet provided by Adobe. I've done that using:

<link rel="stylesheet" href="https://use.typekit.net/mnt0knw.css">

Then I tried to use the font in that stylesheet through embedded HTML:

<style type="text/css">
p {    
    text-align:center; 
    font-family:bebas-neue-pro, sans-serif; 
    font-display:auto;
    font-style:normal;
    font-weight:600;
    font-stretch:normal;
    font-size:75px; 
    color:#ffffff;
}
</style>
<p style="margin-top:0px; margin-bottom:0px;">TEST</p>

That didn't work, so I tried preload:

<link rel="preload" href="https://use.typekit.net/mnt0knw.css" as="style">

Still no luck.

It looks like the problem might be that the iframes Wix uses for embedded HTML do not use the parent's stylesheets. I'm stuck with Wix here, so I would appreciate any help on how to apply the stylesheet to the iframes. The best solution I have so far is adding them individually to each iframe:

<link rel="stylesheet" href="https://use.typekit.net/mnt0knw.css">
<style type="text/css">
p {    
    text-align:center; 
    font-family:bebas-neue-pro, sans-serif; 
    font-display:auto;
    font-style:normal;
    font-weight:600;
    font-stretch:normal;
    font-size:75px; 
    color:#af1717;
}
</style>
<p style="margin-top:0px; margin-bottom:0px;">TEST</p>

Obviously that makes loading the page a complete pain, and exceedingly slow. So there has to be something better, right?

Thanks so much for your help.

Scott



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source