0
0
SASSmarkup~20 mins

SASS with PostCSS pipeline - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
SASS & PostCSS Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the main role of PostCSS in a SASS build pipeline?

Consider a build process where SASS files are compiled to CSS, then processed by PostCSS. What is the primary purpose of PostCSS in this setup?

ATo compile SASS syntax into standard CSS
BTo add vendor prefixes and optimize the compiled CSS for browser compatibility
CTo minify JavaScript files linked in the project
DTo convert HTML files into CSS stylesheets
Attempts:
2 left
💡 Hint

Think about what happens after SASS compilation before the CSS is sent to browsers.

📝 Syntax
intermediate
2:00remaining
Which PostCSS plugin configuration correctly adds vendor prefixes in a SASS pipeline?

Given a PostCSS setup, which plugin configuration will correctly add vendor prefixes to the CSS output from SASS?

SASS
module.exports = {
  plugins: {
    // Which plugin here?
  }
};
A"autoprefixer": {}
B"cssnano": {}
C"postcss-import": {}
D"stylelint": {}
Attempts:
2 left
💡 Hint

Look for the plugin that automatically adds browser prefixes.

rendering
advanced
3:00remaining
What will be the final CSS output after SASS and PostCSS processing?

Given the following SASS code and PostCSS with autoprefixer enabled, what is the final CSS output?

SASS
$main-color: #3498db;

.button {
  display: flex;
  background-color: $main-color;
  user-select: none;
}
A
.button {
  display: -webkit-flex;
  background-color: #3498db;
  user-select: none;
}
B
.button {
  display: flex;
  background-color: $main-color;
  user-select: none;
}
C
.button {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  background-color: #3498db;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
D
.button {
  display: flex;
  background-color: #3498db;
  user-select: none;
}
Attempts:
2 left
💡 Hint

Remember autoprefixer adds vendor prefixes for better browser support.

selector
advanced
2:30remaining
Which CSS selector is generated by this nested SASS code after PostCSS processing?

Given this SASS snippet, what is the correct CSS selector generated?

SASS
.nav {
  ul {
    margin: 0;
    li {
      list-style: none;
      &:hover {
        color: red;
      }
    }
  }
}
A.nav ul li:hover { color: red; }
B.nav ul:hover li { color: red; }
C.nav ul li & :hover { color: red; }
D.nav:hover ul li { color: red; }
Attempts:
2 left
💡 Hint

Look at how nested selectors combine in SASS.

accessibility
expert
3:00remaining
How can PostCSS help improve accessibility in CSS generated from SASS?

Which PostCSS plugin or technique can be used to enhance accessibility by improving focus styles in CSS output from SASS?

AUsing <code>stylelint</code> to automatically add ARIA attributes in CSS
BUsing <code>cssnano</code> to minify CSS and remove all focus styles
CUsing <code>postcss-import</code> to import external CSS files
DUsing <code>postcss-focus-visible</code> plugin to apply focus styles only when keyboard navigation is used
Attempts:
2 left
💡 Hint

Think about focus styles that help keyboard users without distracting mouse users.