Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Modular CSS with Sass Modular Media Queries Creating Element States

No more @at-root

So in the latest version of Sass, there's no more @at-root. But can anyone tell me what I'm supposed to replace it with in this case? I've read Gil's blog post, but it was about no longer using @at-root with keyframes, so I'm a little confused.

.is-displayed-mobile {
    @include mq(small) {
        display: block;

        @at-root (with: media) {
            .is-hidden-mobile {
                display: none;
            }
        }
    }
    @include mq(medium) {
        display: none;
    }
}

1 Answer

Joel Bardsley
Joel Bardsley
31,249 Points

Where have you heard that @at-root has been removed altogether? As far as I'm aware, it's still included but just not required anymore when using @keyframes.