Skip to content

Instantly share code, notes, and snippets.

@scottkellum
Forked from Snugug/extend in media.md
Created April 20, 2012 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottkellum/2431779 to your computer and use it in GitHub Desktop.
Save scottkellum/2431779 to your computer and use it in GitHub Desktop.

Sass

%half { width: 50%; }
%full { width: 100%; }

#foo {
  @extend %full;

  @media screen (min-width: 600px) {
    @extend %half;
  }
}

#bar {
  @extend %full;
}

#baz {
  @extend %half;
}

CSS

#foo, #bar {
  width: 100%;
}

@media screen and (min-width: 600px) {
  #foo {
    width: 50%;
  }
}

#baz {
  width: 50%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment