0
0
Svelteframework~5 mins

Preprocessor support (SCSS, PostCSS) in Svelte - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Asvelte-preprocess
Bsass-loader
Cpostcss-cli
Dcssnano
How do you tell Svelte to treat styles as SCSS inside a component?
AAdd lang="scss" to the style tag
BRename the file to .scss
CUse a separate .scss file only
DAdd a script tag with lang="scss"
What does PostCSS mainly help with in CSS processing?
AMinifying HTML
BCompiling JavaScript
CRunning Svelte components
DAdding vendor prefixes and transformations
Which config file do you modify to add preprocessors in a Svelte project?
Avite.config.js
Bpackage.json
Csvelte.config.js
Drollup.config.js
What must you install to use SCSS with svelte-preprocess?
Aless
Bsass
Cstylus
Dpostcss
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.