Skip to content

Instantly share code, notes, and snippets.

@sugarenia
Created April 19, 2014 07:33
Show Gist options
  • Save sugarenia/11076960 to your computer and use it in GitHub Desktop.
Save sugarenia/11076960 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
// Hacking made easy
// ---
// A couple of Sass functions
// To ease the pain of dealing
// With special values for IE
// ---
// I can see this being useful
// To explain what are those weird `\9`
// Especially for new developers
// Coming up in a project
// Internet Explorer 6
// ---
// @param [literal] $value: value for Internet Explorer 6
@function ie6($value) {
@return #{'_' + $value};
}
// Internet Explorer 6-7
// ---
// @param [literal] $value: value for Internet Explorer 6 and 7
@function ie7($value) {
@return #{'!' + $value};
}
// Internet Explorer 6-8
// ---
// @param [literal] $value: value for Internet Explorer 6 to 8
@function ie8($value) {
@return #{$value + ' \9'};
}
// Internet Explorer 9-10
// ---
// @param [literal] $value: value for Internet Explorer 9 and 10
@function ie9($value) {
@return #{$value + '\0'};
}
// Internet Explorer 6-10
// ---
// @param [literal] $value: value for Internet Explorer 6 to 10
@function ie10($value) {
@return #{$value + '\9'};
}
test {
/* Internet Explorer 10 */
property: ie10(valueForIE10);
/* Internet Explorer 9 */
property: ie9(valueForIE9);
/* Internet Explorer 8 */
property: ie8(valueForIE8);
/* Internet Explorer 7 */
property: ie7(valueForIE7);
/* Internet Explorer 6 */
property: ie6(valueForIE6);
/* Any other browser */
property: value;
}
test {
/* Internet Explorer 10 */
property: valueForIE10\9;
/* Internet Explorer 9 */
property: valueForIE9\0;
/* Internet Explorer 8 */
property: valueForIE8 \9;
/* Internet Explorer 7 */
property: !valueForIE7;
/* Internet Explorer 6 */
property: _valueForIE6;
/* Any other browser */
property: value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment