In Sass, what comments are compiled into CSS and what comments are not?
Experience Level: Junior
Tags: Sass
Answer
Single line comments starting with // are removed and won't be added to the CSS output.
Multi-line comments /* */ are preserved and will be added to the CSS output
Sass// This comment won't be in the CSS after compilation.
.button {
border: solid 1px black;
background-color: whitesmoke;
}
/* This comment will
be in the CSS after compilation */
body {
color: green;
}
CSS
.button {
border: solid 1px black;
background-color: whitesmoke;
}
/* This comment will
be in the CSS after compilation */
body {
color: green;
}
Related Sass job interview questions
In Sass, can you declare two different variables that have the same name and different scope? Describe what happens in such situation.
Sass JuniorWhat Sass variable scopes do you know and what are the differences between them?
Sass JuniorWhat operators can you use in Sass expressions?
Sass JuniorWhat is Nesting in Sass and how does it help with organization of your styles?
Sass JuniorHow do you declare a custom function in Sass?
Sass Junior