Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Use Sass to compensate for deficiencies detected by Modernizr.js
// For example, use "no-cssanimations" for a browser that lacks CSS3 animation support
@mixin modernizr($test) {
html.#{$test} & {
@content;
}
}
@taupecat
Copy link
Author

taupecat commented Nov 16, 2012

Usage:

.selector {
    left: 0;

    @include modernizr(no-cssanimations) { left: 400px; }
}

Compiles to:

.selector {
    left: 0;
}

html.no-cssanimations .selector {
    left: 400px;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment