Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depreciate warning when i use @extend with classes with words separated by - #678

Closed
felquis opened this issue Mar 6, 2013 · 3 comments
Closed

Comments

@felquis
Copy link

felquis commented Mar 6, 2013

With this I get a warning.

@media only screen and (max-width: 482px) {

        .slider-inicial {
                .flex-next {
                        background-position: 100% 50%;
                        right: 0;

                        @extend .slider-controls-default;
                }

                .flex-prev {
                        background-position: 0 50%;
                        left: 0;
                        @extend .slider-controls-default;
                }
        }

        .slider-controls-default {
                width: 27px;
                height: 100%;
                text-indent: -9999px;
                margin: 0 0;
                cursor: pointer;
                margin-top: 0;
                top: 0;
                background-image: image-url('layout/mobile-slide-seta.png');
                background-repeat: no-repeat;
        }
}

When compiling is shown in terminal

DEPRECATION WARNING on line 16 of c:/server/www/ecommerce-template/sas
  @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.

It is similar to #501

But, this works very well.

@media only screen and (max-width: 482px) {

    .slider-inicial {
        .flex-next {
            background-position: 100% 50%;
            right: 0;

            @extend .slidercontrolsdefault;
        }

        .flex-prev {
            background-position: 0 50%;
            left: 0;
            @extend .slidercontrolsdefault;
        }
    }

    .slidercontrolsdefault {
        width: 27px;
        height: 100%;
        text-indent: -9999px;
        margin: 0 0;
        cursor: pointer;
        margin-top: 0;
        top: 0;
        background-image: image-url('layout/mobile-slide-seta.png');
        background-repeat: no-repeat;
    }
}

I'm using Sass v3.2.6, Compass v0.12.2 and Ruby v1.9.3

:shipit: This is a bug?

@nex3
Copy link
Contributor

nex3 commented Mar 6, 2013

I can't reproduce this with Sass 3.2.6. I suspect you have another selector elsewhere in the document that contains .slider-controls-default.

@nex3 nex3 closed this as completed Mar 6, 2013
@felquis
Copy link
Author

felquis commented Mar 7, 2013

Hoo you are right. But the scope of the @media does not work for this case similar to the variables?

Thank you 😄

@nex3
Copy link
Contributor

nex3 commented Mar 7, 2013

No, we decided to have this case produce a warning (and an error in future versions) because we don't want users getting confused about why their @extend isn't working outside of @media.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants