0
0
SASSmarkup~5 mins

Flexbox utility class generation in SASS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the main purpose of Flexbox utility classes in CSS?
Flexbox utility classes help quickly apply common flexbox properties like layout direction, alignment, and spacing without writing custom CSS each time.
Click to reveal answer
intermediate
In Sass, how can you generate multiple utility classes for flexbox properties efficiently?
You can use Sass loops like @each or @for to create classes dynamically by iterating over lists or maps of property values.
Click to reveal answer
beginner
What does the following Sass snippet do? @each $dir in row, column { .flex-#{$dir} { display: flex; flex-direction: $dir; } }
It creates two classes: .flex-row and .flex-column. Each sets display to flex and flex-direction to row or column respectively.
Click to reveal answer
beginner
Why is it helpful to generate flexbox utility classes with Sass instead of writing each class manually?
It saves time, reduces errors, and keeps code consistent and easy to update by changing values in one place.
Click to reveal answer
beginner
Name three common flexbox properties you might include in utility classes.
flex-direction, justify-content, align-items
Click to reveal answer
Which Sass directive is best for creating multiple similar flexbox utility classes?
A@each
B@if
C@mixin
D@extend
What CSS property does the class .flex-row typically set?
Aflex-direction: row
Bjustify-content: center
Calign-items: flex-start
Ddisplay: block
Why use utility classes for flexbox instead of writing styles inline or in separate CSS rules?
AThey increase CSS file size unnecessarily
BThey only work in old browsers
CThey prevent responsive design
DThey allow quick reuse and consistent styling across the site
Which Sass feature helps keep utility class code DRY (Don't Repeat Yourself)?
AVariables only
BLoops like @each
CComments
DPlain CSS
What is the visual effect of applying .flex-center utility class that sets justify-content and align-items to center?
AItems overflow outside the container
BItems are aligned to the left
CItems are centered horizontally and vertically inside the container
DItems stack vertically with space between
Explain how you would use Sass to generate utility classes for flexbox directions and alignments.
Think about looping over lists of property values and combining them into class names.
You got /4 concepts.
    Describe the benefits of using flexbox utility classes generated by Sass in a web project.
    Consider how utility classes improve workflow and code quality.
    You got /4 concepts.