- Save script to e.g.
/usr/local/bin/media-query-combiner chmod +x /usr/local/bin/media-query-combiner
Reads from stdin and writes to stdout.
| /** | |
| * Setup images sprite having high resolution variant for retina displays. | |
| * | |
| * It will create class names for all available icons. | |
| * | |
| * This uses custom function to prefix selectors from array. To get it working you will need to include following snippet in your config.rb | |
| * | |
| * module Sass::Script::Functions | |
| * def prefix_each(array, prefix) | |
| * return Sass::Script::String.new array.to_a.map{|item| prefix.value + item.value}.join(", ") |
| # best path for assets in Wordpress project | |
| http_path = "/wp-content/themes/TheFold/" | |
| css_dir = "." | |
| sass_dir = "sass" | |
| images_dir = "img" | |
| javascripts_dir = "js" | |
| fonts_dir = "fonts" | |
| output_style = :expanded | |
| environment = :development |
| var gistPrefix = 'http://gist.github.com/', | |
| // Cache document.write so that it can be restored once all Gists have been | |
| // embedded. | |
| cachedWrite = document.write, | |
| body = jQuery('body'), | |
| // Map each p.gist to an object that contains the paragraph to be replaced | |
| // and the Gist's identifier. | |
| gists = jQuery('p.gist').map(function(n, p) { | |
| p = jQuery(p); |
| // ---------------------------------------------------------- | |
| // A short snippet for detecting versions of IE in JavaScript | |
| // without resorting to user-agent sniffing | |
| // ---------------------------------------------------------- | |
| // If you're not in IE (or IE version is less than 5) then: | |
| // ie === undefined | |
| // If you're in IE (>=5) then you can determine which version: | |
| // ie === 7; // IE7 | |
| // Thus, to detect IE: | |
| // if (ie) {} |