I’m working on two different WordPress sites that are in many ways similar but are skinned differently.
For example, let’s say I’m working on two ‘magazine’ sites, which share the same CSS layout e.g. grid system, margin’s etc., but different CSS decorational properties e.g. gradients, colours, shadows.
What is the best way to get them to share the same base CSS layout, but different decorational CSS?
Initially I thought something like …
<link rel="stylesheet" type="text/css" media="all" href="LINK-TO-BASE-CSS-ON-PRIMARY-DOMAIN.css" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'template_url' ); ?>/style.css" /> <!-- This would be the 'top-up' CSS -->
This doesn’t seem particularly clean to me though. I admit though, there is also a very similar question here.
Is this still considered the best way?
Are there any disadvantages to linking to another domain? I’ve read that this may even be an advantage because of cross-domain loading.
What you suggested is fine. I’m not sure that there is an advantage called “cross-domain loading”, but hosting your style sheets in another server is a very common practice. This other server is known as a CDN, or Content Delivery Network. Here’s some information about CDNs and their advantages:
http://www.sitepoint.com/7-reasons-to-use-a-cdn/
Also, pro-tip: do some DNS prefetching if you’re going to use a separate domain to host your files. It’s as easy as:
try to separate layout structure and templates and call everything from the same domain
OR
Benefit of this solution is that you can adtionaly offer switching templates 😀
You can use this filter, to filter out styles with any condition or alternate output href string, example: