What does @ at-root do?

2

Well I used the translator to read this SASS documentation and I did not understand the what he can do ... Then:

  • What does @at-root do?
asked by anonymous 24.06.2016 / 23:24

1 answer

5

@at-root is a directive. It works to ' jump ' from where you nested in your Sass to a higher level.

For example, you can use it like this:

h1 {
    font-size: 16px;
    @at-root {
        header {
            margin: 0 auto;
            width: 98%;
        }
    }
}

And the result looks like this:

h1 {
    font-size: 16px;
}

header {
    margin: 0 auto;
    width: 98%;
}

Font

    
25.06.2016 / 00:24