{"id":133,"date":"2009-02-13T15:30:41","date_gmt":"2009-02-13T20:30:41","guid":{"rendered":"http:\/\/www.blizzarddigital.com\/blog\/?p=133"},"modified":"2010-04-18T19:43:09","modified_gmt":"2010-04-18T23:43:09","slug":"organizing-your-css-files","status":"publish","type":"post","link":"https:\/\/www.blizzarddigital.com\/blog\/organizing-your-css-files\/","title":{"rendered":"Organizing Your CSS Files"},"content":{"rendered":"<p>When I create a web site, I like to organize my stylesheets and images into a specific folder structure. It keeps things tidy and separates presentation files (stylesheets and\u00a0images)\u00a0from content files (pages and images related to the content). It also leaves room for additional stylesheet &#8220;themes&#8221; for your site.<\/p>\n<p>Here is an example of\u00a0this folder structure:<\/p>\n<p><em>\/styles\/<br \/>\n\/styles\/default\/<br \/>\n\/styles\/default\/images\/<\/em><\/p>\n<p><em>Default<\/em> in this example would be the name of the &#8220;theme&#8221;. The sites I develop typically do not have multiple themes for the user to pick, so I don&#8217;t usually take the time to give them fancy names. However, if your site utilizes multiple stylesheets\u00a0that the user could choose from (such as at the <a onclick=\"return OpenOffSite(this)\" href=\"http:\/\/www.csszengarden.com\/\">CSS Zen Garden<\/a>), creative names would be helpful.<\/p>\n<p>All stylesheets for the <em>Default<\/em> theme would be placed in the <em>\/styles\/default\/<\/em> folder. Likewise, images used by those stylesheets would go in the <em>\/styles\/default\/images\/<\/em> folder.<\/p>\n<p>This method keeps your styles consolidated and makes it easy to use them across multiple sites. All you need to do is copy the folder to the other site; you don&#8217;t need to pick through the <em>images<\/em> folder and figure out which ones are used by the stylesheet and which ones aren&#8217;t.<\/p>\n<p>Technically, you wouldn&#8217;t even need to copy anything to another site. You could just specify the full\u00a0URL in the <em>link<\/em> element or <em>@import<\/em> rule\u00a0on the page, but I urge you not to do this. Your visitors may be using security software that sees cross-site references as malicious, thus blocking the stylesheet from downloading or, worse, blocking the entire page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to keep your styles consolidated and make it easy to use them across multiple websites.<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[20,6,25],"class_list":["post-133","post","type-post","status-publish","format-standard","hentry","category-web-standards","tag-css","tag-web-design","tag-web-development"],"_links":{"self":[{"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/posts\/133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/comments?post=133"}],"version-history":[{"count":4,"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/posts\/133\/revisions"}],"predecessor-version":[{"id":135,"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/posts\/133\/revisions\/135"}],"wp:attachment":[{"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/media?parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/categories?post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blizzarddigital.com\/blog\/wp-json\/wp\/v2\/tags?post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}