Recall & Review
beginner
What is a vendor prefix in CSS?
A vendor prefix is a special code added before CSS properties to ensure they work in specific browsers. Examples include
-webkit- for Chrome and Safari, -moz- for Firefox, and -ms- for Internet Explorer.Click to reveal answer
beginner
Why use mixins for vendor prefixes in Sass?
Mixins let you write vendor prefixes once and reuse them everywhere. This saves time, avoids mistakes, and keeps your code clean and easy to update.Click to reveal answer
beginner
Example of a simple vendor prefix mixin for
border-radius in Sass?@mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
border-radius: $radius;
}
Click to reveal answer
intermediate
How do vendor prefix mixins improve maintainability?
If browser support changes, you only update the mixin once. All styles using that mixin update automatically, making your project easier to maintain.
Click to reveal answer
intermediate
What is a common pattern to handle multiple vendor prefixes in one mixin?
Use a mixin that sets all needed prefixes plus the standard property. Pass the value as a parameter to keep it flexible and reusable.
Click to reveal answer
What does the
-webkit- prefix target?✗ Incorrect
The
-webkit- prefix is used mainly for Chrome and Safari browsers.Why use a mixin for vendor prefixes in Sass?
✗ Incorrect
Mixins help write vendor prefixes once and reuse them, saving time and reducing errors.
Which of these is NOT a vendor prefix?
✗ Incorrect
-html- is not a vendor prefix.What is the main benefit of updating a vendor prefix mixin?
✗ Incorrect
Updating a mixin updates all styles that use it, improving maintainability.
How do you pass values to a vendor prefix mixin?
✗ Incorrect
Values like sizes or colors are passed as parameters to keep mixins flexible.
Explain what vendor prefix mixins are and why they are useful in Sass.
Think about how writing prefixes once helps many places.
You got /3 concepts.
Describe how you would write a mixin to handle vendor prefixes for a CSS property.
Start with @mixin and include all prefixes inside.
You got /3 concepts.