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 Challenge

Challenge Link:

http://teamtreehouse.com/library/modular-css-with-sass/modular-media-queries/modular-media-queries-challenge

Challenge Task 1 of 1

Add the statement that instructs @at-root to output the nested state rule outside the @media query.

What's messed up about this question is the phrase

"to output the nested state rule outside the"

If you were confused by what exactly this is asking (or talking about), you are not alone.

So, rather than try to review all the videos associated with 'Modular Media Queries' subsection of the 'Modular CSS with Sass' course I decided to re-phrase the questions as:

When using '@root' nested inside '@media',

what are the possible values that can appear in parenthesis

after @root (but on the same line as @root)

Using this as a google search criteria. I eventually found this github code page:

https://gist.github.com/gorillawit/8245799

Here is the relevant code from that page:

.my-widget {
@media (min-width: 300px) {
  .inside-mq {
  inside-style: mq;
  }
  @at-root (without: media) {
  //this without:media tells the screen what to bust out of
  .outside-mq {
  outside-style: mq;
  }
}

// using (without:all) forces all nested selectors outside of all media
// queries, hence color:blue only in the .outside-everything class in generated css
  @at-root (without:all) {
  .outside-class {
  color: blue;
  }
}
// using the (with:media) keeps .with-only inside media query hence .with-only selector
// inside @media ()min-width:300px
@at-root (with: media) {
  .with-only {
  // do this ONLY inside mq
   color: pink;
   }
  }
 }
}

Studying that code snippet, the 3 values that can appear in parenthesis after '@root' are:

  • (with: media)
  • (without: media)
  • (without:all)

I tried all three and what passed was:

---

Somehow this course seems more 'advanced' than 'intermediate'.

Since '@root' was discussed in 'Advanced Directives' section

of the 'Advanced SASS' course:

http://teamtreehouse.com/library/advanced-sass/advanced-directives/the-atroot-directive

..I really think that Modular SASS belongs

AFTER that advanced course

(leastwise it wouldn't hurt to do the courses in that order...)

4 Answers

@media (min-width: 769px) { 
  display: block;
  @at-root (without: media){ 
    .is-hidden-mobile { 
      display: none; 
    } 
  } 
}
Devin Scheu
Devin Scheu
66,191 Points

Thanks James for clearing this up for people!

Sue Dough
Sue Dough
35,800 Points

Your wp-content/uploads folder is insecure on your website. Add a file and name it .htaccess inside of the wp-content folder with the following code inside of the file.

Options -Indexes

Thank you for posting this.. I was stuck on the question for a while

Justin Farrar
Justin Farrar
7,780 Points

Thanks, I didn't know what was going on. I was definitely stuck for a lil bit