Overview of Sass At-Rules
mainSass extends standard CSS functionality by adding several custom at-rules. These rules allow for modularity, logic, and debugging capabilities that are not available in plain CSS.
Module System
@use: Loads mixins, functions, and variables from other Sass stylesheets and combines CSS from multiple stylesheets.@forward: Loads a Sass stylesheet and makes its members (mixins, functions, variables) available to the stylesheet that subsequently@usees it.@import: (Legacy) Extends the CSS at-rule to load styles, mixins, functions, and variables from other stylesheets.
Style Reusability and Inheritance
@mixinand@include: Used to define and re-use chunks of styles.@extend: Allows selectors to inherit styles from other selectors.
Logic and Functions
@function: Defines custom functions for use in SassScript expressions.- Flow Control: Rules like
@if,@each,@for, and@whilecontrol the conditional emission or repetition of styles.
Debugging and Error Handling
@error: Stops compilation and outputs an error message.@warn: Prints a warning message but allows compilation to continue.@debug: Prints a message for debugging purposes.
Scoping
@at-root: Forces styles within the rule to be placed at the root of the CSS document, bypassing nesting.