What Sass Is
Which statement best describes Sass in the context of styling web pages?
- Sass is a stylesheet preprocessor that adds features like variables, nesting, and mixins and compiles to CSS.
- Sass is a CSS reset that removes default browser styles.
- Sass is a JavaScript framework for building user interfaces.
- Sass is a browser plugin that speeds up page loading.
- Sass is an HTML templating language.
SCSS File Extension
If you are using the SCSS syntax of Sass, which file extension should your stylesheet use?
- .scss
- .sass
- .css
- .scs
- .sassx
Using Variables
Given the Sass code $gap: 10px; .box { margin: $gap; }, what will the compiled CSS margin value be for .box?
- margin: 10px;
- margin: $gap;
- margin: var(--gap);
- margin: 10;
- margin: px10;
Nesting Selectors
If you write Sass as nav { ul { margin: 0; } }, which CSS selector will the nested rule compile into?
- nav ul { margin: 0; }
- nav u003E ul { margin: 0; }
- .nav ul { margin: 0; }
- ul nav { margin: 0; }
- nav:ul { margin: 0; }
Mixins and Reuse
What Sass feature lets you define reusable declarations with @mixin and apply them with @include, such as @include rounded(4px)?
- Mixins
- Modules
- Placeholders
- Macros
- Mixens
Extending with Placeholders
Given %btn { padding: 8px; } and .primary { @extend %btn; }, what effect does @extend have on .primary in the compiled CSS?
- It applies the styles from %btn to .primary so .primary gets padding: 8px;
- It imports an external file named btn into .primary;
- It converts %btn into a mixin and includes it;
- It sets a CSS variable named %btn on .primary;
- It removes the .primary rule from the output;
Partials and @use
If you have a partial file named _colors.scss that defines variables, which modern Sass statement should you write in another file to load it?
- @use 'colors';
- @import '_colors.scss';
- @include 'colors';
- @require 'colors';
- @apply 'colors';
Math in Sass
What is the compiled CSS result of width: (600px / 2) written in a Sass rule?
- width: 300px;
- width: 600/2px;
- width: 300;
- width: calc(600px / 2);
- width: 3e2px;
Color Utilities
When you write color: lighten(#3366ff, 10%); in Sass, what capability are you using to adjust the color before output?
- Built-in color functions
- Media query mixins
- CSS custom properties
- Vendor-specific prefixes
- Lightner functions
Compilation to CSS
Which statement about using .scss files in the browser is correct?
- Browsers cannot read .scss directly, so Sass must be compiled into plain .css before being served.
- Modern browsers can natively parse and execute .scss files without any build step.
- Only mobile browsers support .scss files if a viewport meta tag is present.
- Browsers can read .scss directly if the file is linked with rel='stylesheet/sass'.
- You must inline .scss in a script tag for browsers to understand it.