Skip to content

Instantly share code, notes, and snippets.

@rosschapman
Created July 1, 2013 21:03
Show Gist options
  • Save rosschapman/5904610 to your computer and use it in GitHub Desktop.
Save rosschapman/5904610 to your computer and use it in GitHub Desktop.
Firefox only SASS mixin
@mixin FF-only {
@-moz-document url-prefix() { @content; }
}
@stevenvachon
Copy link

@mixin firefox-only {
  @at-root {
    @-moz-document url-prefix() {
      & {
        @content;
      }
    }
  }
}

adds support for nesting:

a {
  prop: val;

  b {
    @include firefox-only {
      prop: val;
    }
  }
}

which will produce:

a {
  prop: val;
}

@-moz-document url-prefix() {
  a b {
    prop: val;
  }
}

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