Skip to content

Instantly share code, notes, and snippets.

@MrOrz
Created August 29, 2013 02:55
Show Gist options
  • Save MrOrz/6373773 to your computer and use it in GitHub Desktop.
Save MrOrz/6373773 to your computer and use it in GitHub Desktop.
@extending a selector within the same @media directive still gives deprecation warning.
// A placeholder factory that generates a placeholder.
=btn-placeholder($border-color)
%btn
border: 1px solid $border-color
border-radius: 8px
// Generate a %btn placeholder here.
+btn-placeholder(#000)
// Use the %btn placeholder in the following two classes
.btn-error
@extend %btn
background: #f00
.btn-success
@extend %btn
background: #0f0
@media screen and (min-width: 750px)
// Here we invoke the placeholder factory again,
// this time from within the @media
+btn-placeholder(#999)
// The following classes in @media uses the placeholder
// inside the @media.
.btn-error
@extend %btn
background: #c00
.btn-success
@extend %btn
background: #0c0
@adi518
Copy link

adi518 commented Apr 4, 2016

Hi,

Tried it and doesn't seem to compile. I guess it became deprecated.

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