I recently played with Polymer , and finally, I think I have a head around the border of the shadow, at least to the point where I know where I need to include link tags to make my CSS work.
It's fine and dandy, but I can't use Google fonts. If I use @import inside my stylesheet, then as soon as this stylesheet is included in the Polymer user element, I get CORS issues:
XMLHttpRequest cannot load http://fonts.googleapis.com/css?family=Maven+Pro:400,700. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:64000' is therefore not allowed access
XMLHttpRequest is present here, perhaps because of the way Polymer retrieves resources and custom elements in the first place, which I suppose is an axion of the header mentioned in the error message.
However, if I use only the link method
<link href='http://fonts.googleapis.com/css?family=Maven+Pro:400,700' rel='stylesheet' type='text/css'>
This does not cross the shadow border, and I still do not get my fonts.
Am I missing something obvious? How to get Google fonts in shadow DOM? I tried to download the zip file from Google Fonts themselves, but I only got the TTF files.
source share