Recall & Review
beginner
What is the purpose of using SCSS or PostCSS in a Svelte project?
SCSS and PostCSS help write CSS more efficiently by allowing features like variables, nesting, and automatic vendor prefixing, making styles easier to manage and maintain.
Click to reveal answer
intermediate
How do you enable SCSS support in a Svelte project?
Install the necessary packages like 'svelte-preprocess' and 'sass', then configure 'svelte.config.js' to use 'svelte-preprocess' with SCSS enabled.
Click to reveal answer
intermediate
What role does 'svelte-preprocess' play when using PostCSS in Svelte?
'svelte-preprocess' acts as a bridge to process styles with PostCSS plugins before Svelte compiles the component, enabling features like autoprefixing and custom transformations.
Click to reveal answer
beginner
How can you write SCSS inside a Svelte component's style tag?
Add the attribute
lang="scss" to the <style> tag, like <style lang="scss">, so the preprocessor knows to compile SCSS syntax.Click to reveal answer
intermediate
Why is PostCSS useful for responsive design in Svelte projects?
PostCSS can automatically add vendor prefixes and support plugins that help write responsive CSS, making styles work well across different browsers and devices.
Click to reveal answer
Which package is commonly used to enable SCSS preprocessing in Svelte?
✗ Incorrect
svelte-preprocess integrates SCSS and other preprocessors into Svelte's build process.
How do you tell Svelte to treat styles as SCSS inside a component?
✗ Incorrect
The lang attribute on the style tag signals Svelte to preprocess SCSS.
What does PostCSS mainly help with in CSS processing?
✗ Incorrect
PostCSS uses plugins to transform CSS, like adding prefixes for browser support.
Which config file do you modify to add preprocessors in a Svelte project?
✗ Incorrect
svelte.config.js is where you set up preprocessors like SCSS or PostCSS.
What must you install to use SCSS with svelte-preprocess?
✗ Incorrect
The 'sass' package compiles SCSS syntax and is required alongside svelte-preprocess.
Explain how to set up SCSS preprocessing in a Svelte project from scratch.
Think about packages, config, and component style tags.
You got /3 concepts.
Describe the benefits of using PostCSS in Svelte styling.
Focus on what PostCSS does to CSS before it reaches the browser.
You got /4 concepts.