Sass @at-root Rules

You are Here:

Sass @at-root Rules

The @at-rule allows you to whether or not to target the root of the document instead of using the normal nesting.

Sass @at-root Rules using 'Without'

The following example's @at-root will target the root of the document.

Example

SASS TO CSS CONVERTER
@media print { .style { font-size: 17px; color: green; @at-root (without: media) { color: red; } } }

Syntax

@at-root <without: rules...> // or @at-root <with: rules...>

Sass @at-root Rules using 'With'

Example

The following example's @at-root will target its parent @media.

SASS TO CSS CONVERTER
@media print { .style { font-size: 17px; color: green; @at-root (with: media) { color: red; } } }

Reminder

Hi Developers, we almost covered 99.1% of Sass Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in Sass.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author