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?
Think about what happens after SASS compilation before the CSS is sent to browsers.
PostCSS is used after SASS compilation to transform CSS with plugins, such as adding vendor prefixes for better browser support and optimizing CSS. It does not compile SASS or handle JavaScript or HTML.
Given a PostCSS setup, which plugin configuration will correctly add vendor prefixes to the CSS output from SASS?
module.exports = { plugins: { // Which plugin here? } };
Look for the plugin that automatically adds browser prefixes.
"autoprefixer" is the PostCSS plugin that adds vendor prefixes to CSS rules. "cssnano" minifies CSS, "postcss-import" handles imports, and "stylelint" is for linting CSS.
Given the following SASS code and PostCSS with autoprefixer enabled, what is the final CSS output?
$main-color: #3498db; .button { display: flex; background-color: $main-color; user-select: none; }
Remember autoprefixer adds vendor prefixes for better browser support.
The SASS variable is replaced with its value. Autoprefixer adds vendor prefixes for display: flex and user-select properties to support older browsers.
Given this SASS snippet, what is the correct CSS selector generated?
.nav { ul { margin: 0; li { list-style: none; &:hover { color: red; } } } }
Look at how nested selectors combine in SASS.
The &:hover inside li means the hover state of li. So the full selector is .nav ul li:hover.
Which PostCSS plugin or technique can be used to enhance accessibility by improving focus styles in CSS output from SASS?
Think about focus styles that help keyboard users without distracting mouse users.
postcss-focus-visible adds support for the :focus-visible pseudo-class, which shows focus outlines only when users navigate with keyboard, improving accessibility. Other plugins do not handle focus styles or ARIA attributes.