{"name":"support-for","version":"1.0.3","description":"Allows Sass authors to conditionally add support for specific browser versions.","homepage":"https://github.com/JohnAlbin/support-for","bugs":{"url":"https://github.com/JohnAlbin/support-for/issues"},"repository":{"type":"git","url":"git://github.com/JohnAlbin/support-for.git"},"author":{"name":"John Albin Wilkins","email":"virtually.johnalbin@gmail.com","url":"http://john.albin.net/"},"keywords":["eyeglass-module","support-for","sass","browser support","support"],"main":"sass/_support-for.scss","eyeglass":{"exports":"eyeglass-exports.js","needs":"^0.7.1"},"scripts":{"test":"mocha","posttest":"eslint test"},"license":"GPL-2.0","devDependencies":{"chai":"^3.4.1","eslint":"^1.9.0","mocha":"^2.3.4","sassy-test":"^2.0.0"},"gitHead":"20ba4f25917cea644fc68041e3e1607827d52b64","_id":"support-for@1.0.3","_shasum":"0feef776c95afef03f21aa79e54bc5763e314940","_from":".","_npmVersion":"3.3.11","_nodeVersion":"5.0.0","_npmUser":{"name":"johnalbin","email":"virtually.johnalbin@gmail.com"},"dist":{"shasum":"0feef776c95afef03f21aa79e54bc5763e314940","tarball":"http://registry-npm.ywwl.com/support-for/download/support-for-1.0.3.tgz","integrity":"sha512-0CojHgOz3vmOEcGZxNVIzZSCN6OTGAv3aj/12v4jW+Bnpn+zy3mbnwI8rT+octMkQ66OlXZyKG7U3j3+DF23ng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDT3NUeVUK1gWqiE9T6PsKK9VXGXmE2pAUGGdHCK34LTQIhAPX21/sENiRCK0gcA7ByYPFhbSfc9F+ihanbtj8W04MD"}],"size":13003,"noattachment":false,"key":"/support-for/-/support-for-1.0.3.tgz"},"maintainers":[{"name":"johnalbin","email":"virtually.johnalbin@gmail.com"}],"readme":"# support-for\n\nThe **support-for** module allows Sass authors to conditionally add support for specific browser versions to their Sass module or Sass partials.\n\n[Autoprefixer](https://github.com/postcss/autoprefixer) is great for conditionally adding vendor prefixes, but sometimes you need more extensive CSS for specific versions of browsers. For example, adding px fallbacks to rem units when you need IE 8 support.\n\nAuthors of Sass code with support-for can specify which browser versions they want to support by setting a simple Sass variable, `$support-for`.\n\nHere are some example usages:\n\n1. The Sass author only wants to support Safari 8 and later (and no other browsers) because he is an asshole.\n\n ```scss\n  $support-for: (\n    safari: 8,\n    '*':    null, // null means \"no support\" and is the\n                  // default value for any browser not\n                  // specified in $support-for\n  );\n\n  // Normalize-scss uses support-for to conditionally\n  // output CSS for old and new browsers.\n  @import \"normalize\";\n```\n\n2. The Sass author wants to support the 4 most recent versions of all browsers which she can do by setting the wildcard browser, `'*'`. She also has to support IE 6 and later because the client hates her.\n\n ```scss\n  $support-for: (\n    '*': -4,\n    ie:  6,\n  );\n\n  @import \"normalize\";\n```\n\n3. The Sass author is working for a government client and every browser version has a specific version specified in the contract.\n\n ```scss\n  $support-for: (\n    chrome:  29,\n    edge:    20,\n    firefox: 26,\n    ie:      8,\n    opera:   14,\n    safari:  5,\n  );\n\n  @import \"normalize\";\n```\n\nBy the way, here's the default value of `$support-for`:\n\n```scss\n// Support the last 4 versions of all browsers except IE.\n$support-for: (\n  chrome:  -4,\n  edge:    -4,\n  firefox: -4,\n  ie:      9,\n  opera:   -4,\n  safari:  -4,\n  '*':     -4,\n) !default;\n```\n\n### Update your Sass partials to use `support-for()`\n\nIf a Sass module tells you that it uses **support-for**, you just need to override the default value of the `$support-for` variable before you import that module. See the examples above to see some of your options.\n\nIf, however, you want to conditionally include Sass in the stylesheets you author, you can update your Sass code to wrap those lines of Sass with an `@if` block that uses the `support-for()` function.\n\n```scss\n@mixin my-sweet-sweet-mixin($cocoa: lots) {\n  border-radius: 100%;\n\n  // Only include this property if we support IE 10.\n  @if support-for(ie, 10) {\n    // Remove border when applied to an `img` inside an `a` element in IE 8/9/10.\n    border: 0;\n  }\n}\n```\n\nIf you later drop support for IE 10 (someday!), you just need to update the\n`$support-for` variable and your code will stop outputting the IE-10-specific\nCSS.\n\n## Updating your module to use support-for\n\nIf you are a Sass module author wanting to use **support-for** in your module, it's\nquite easy to add it as a dependency.\n\n### Ruby Sass\n\nAlter your `my-module.gemspec` file:\n\n1. Find the line for your module's Sass dependency. It should look similar to this:\n\n ```ruby\nspec.add_runtime_dependency('sass', '~> 3.3')\n```\n\n2. Just after that line, add this:\n\n ```ruby\nspec.add_runtime_dependency('support-for', '~> 1.0')\n```\n\n### NPM (and node-sass)\n\nAdd your dependency with the following command:\n\n```bash\nnpm install --save support-for\n```\n\n### Bower\n\nAdd your dependency with the following command:\n\n```bash\nbower install --save support-for\n```\n\n[![Build Status](https://travis-ci.org/JohnAlbin/support-for.png?branch=master)](https://travis-ci.org/JohnAlbin/support-for)\n","publish_time":1448331184797,"_cnpm_publish_time":1448331184797,"dist-tags":{"latest":"1.0.7"}}