Skip to content

Instantly share code, notes, and snippets.

@ekancepts
Created November 1, 2012 15:58
Show Gist options
  • Save ekancepts/3994549 to your computer and use it in GitHub Desktop.
Save ekancepts/3994549 to your computer and use it in GitHub Desktop.
# Error-1
DEPRECATION WARNING on line 21 of /var/www/projects/local-dev/sass/project_responsive/sass/_media-handheld.scss:
@extending an outer selector from within @media is deprecated.
You may only @extend selectors within the same directive.
This will be an error in Sass 3.3.
It can only work once @extend is supported natively in the browser.
# Error-2
DEPRECATION WARNING on line 24 of /var/www/projects/local-dev/sass/project_responsive/sass/_media-handheld-landscape.scss:
@extending an outer selector from within @media is deprecated.
You may only @extend selectors within the same directive.
This will be an error in Sass 3.3.
It can only work once @extend is supported natively in the browser.
#Error-3
DEPRECATION WARNING on line 21 of /var/www/projects/local-dev/sass/project_responsive/sass/_media-handheld.scss:
@extending an outer selector from within @media is deprecated.
You may only @extend selectors within the same directive.
This will be an error in Sass 3.3.
It can only work once @extend is supported natively in the browser.
#Error-4
DEPRECATION WARNING on line 24 of /var/www/projects/local-dev/sass/project_responsive/sass/_media-handheld-landscape.scss:
@extending an outer selector from within @media is deprecated.
You may only @extend selectors within the same directive.
This will be an error in Sass 3.3.
It can only work once @extend is supported natively in the browser.
/*Errors are attached above */
/* Code for Error-1 and Error-3 */
.g-h-c {
@extend .g-base-c;
width: $handheld-width;
@include optional-grid-background(
$total: $handheld-columns,
$column: $handheld-col-width,
$gutter: $gutter-width,
$baseline: $base-line-height
);
}
/* Code for Error-2 and Error-4 */
.g-h-c {
@extend .g-base-c;
width: $handheld-landscape-width;
@include optional-grid-background(
$total: $handheld-landscape-columns,
$column: $handheld-landscape-col-width,
$gutter: $gutter-width,
$baseline: $base-line-height
);
}
@JohnRiv
Copy link

JohnRiv commented Nov 1, 2012

As the error says, you can't use @extend from within a media query (I assume .g-h-c is included in a media query if we were to look at the entire sass file). So you have to either manually duplicate .g-base-c's styles in .g-h-c or create a mixin that will output the styles for .g-base-c and include that in .g-h-c

@DavidStrada
Copy link

@extend .g-base-c; you're trying to auto-extend the class itself? mmmm isually what i do it's i.e.
.g-base{
width: 100%;
bacground: red;
}
.gbase-new{
@extend .g-base;
border: 3px solid red;
}
I don't know if that makes any sense?

@JohnRiv
Copy link

JohnRiv commented Nov 1, 2012

Or you can just do what Chris Eppstein says to do... that's what I do when I'm in doubt ;-) https://twitter.com/chriseppstein/status/264065754289274880

@ekancepts
Copy link
Author

When made following modifications the errors went away

Thanks to following people for assisting
https://twitter.com/chriseppstein
http://thesassway.com/
https://twitter.com/Snugug
https://gist.github.com/JohnRiv

.g-h-c {
@include centered; // this is a simple mixin from compass-layouts that sets margin: 0 auto.
@include pie-clearfix;
/@extend .g-base-c;/
width: $handheld-width;
@include optional-grid-background(
$total: $handheld-columns,
$column: $handheld-col-width,
$gutter: $gutter-width,
$baseline: $base-line-height
);
}

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