0
0
SASSmarkup~5 mins

When to use SASS vs CSS-in-JS - Quick Revision & Key Differences

Choose your learning style9 modes available
Recall & Review
beginner
What is SASS?
SASS is a CSS preprocessor that adds features like variables, nesting, and mixins to regular CSS. It helps write cleaner and reusable stylesheets.
Click to reveal answer
beginner
What does CSS-in-JS mean?
CSS-in-JS means writing CSS styles directly inside JavaScript files, often scoped to components. It allows dynamic styling based on JavaScript logic.
Click to reveal answer
intermediate
When is SASS a good choice?
Use SASS when you want to keep styles in separate files, need powerful CSS features, and prefer traditional stylesheet workflows.
Click to reveal answer
intermediate
When should you consider CSS-in-JS?
Choose CSS-in-JS when working with JavaScript frameworks like React, want styles tightly coupled with components, or need dynamic styling.
Click to reveal answer
intermediate
What is a key difference between SASS and CSS-in-JS?
SASS compiles to static CSS files before the site loads, while CSS-in-JS generates styles at runtime inside JavaScript, often scoped to components.
Click to reveal answer
Which tool allows you to write CSS inside JavaScript files?
ASASS
BPostCSS
CCSS-in-JS
DLESS
When using SASS, styles are compiled into:
AStatic CSS files
BJavaScript objects
CHTML elements
DJSON data
Which scenario best fits CSS-in-JS?
ALarge static website with separate CSS files
BReact app needing dynamic component styles
CSimple HTML page with inline styles
DServer-side rendering without JavaScript
SASS helps by adding which feature to CSS?
AHTML templates
BJavaScript logic
CDatabase queries
DVariables and nesting
Which is a benefit of CSS-in-JS?
AStyles can change based on component state
BStyles are global by default
CRequires separate CSS files
DNo JavaScript needed
Explain when you would choose SASS over CSS-in-JS for a project.
Think about projects that don't rely heavily on JavaScript frameworks.
You got /4 concepts.
    Describe the advantages of CSS-in-JS in modern web development.
    Consider how styles and components work together in React or similar.
    You got /4 concepts.