[theme-reviewers] Importing CSS within style.css

Michael Fields michael at mfields.org
Tue Dec 18 15:24:02 UTC 2012


> There is nothing inherently wrong with using @import, as far as I know. 

There is one thing that comes to mind. Lets say the following code is used in style.css:

@import url(http://fonts.googleapis.com/css?family=Oswald);

This is OK so long as is_ssl() does not return true. In case that it does Chrome will generate a "Insecure Content Loaded" type error message in the console.

One solution is a protocol-relative url like:

@import url(://fonts.googleapis.com/css?family=Oswald);

I do not believe that there is support for this in IE6 and IE7/8 will download the file twice.
See: http://paulirish.com/2010/the-protocol-relative-url/

IMHO, the best method is to enqueue.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20121218/ae7d783d/attachment.htm>


More information about the theme-reviewers mailing list