Challenge - 5 Problems
Vendor Prefix Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate2:00remaining
What is the output CSS of this Sass mixin usage?
Given the following Sass mixin and usage, what CSS will be generated?
@mixin transform($value) {
-webkit-transform: $value;
-moz-transform: $value;
transform: $value;
}
.box {
@include transform(rotate(45deg));
}SASS
@mixin transform($value) { -webkit-transform: $value; -moz-transform: $value; transform: $value; } .box { @include transform(rotate(45deg)); }
Attempts:
2 left
💡 Hint
Remember the order of properties in the mixin matches the output order.
✗ Incorrect
The mixin outputs the properties in the order written: -webkit-transform, then -moz-transform, then transform. The CSS output preserves this order.
🧠 Conceptual
intermediate1:30remaining
Why use vendor prefix mixins in Sass?
Which of the following best explains why developers use vendor prefix mixins in Sass?
Attempts:
2 left
💡 Hint
Think about how mixins help with repetitive code.
✗ Incorrect
Vendor prefix mixins let developers write a property once and generate all necessary prefixed versions, saving time and reducing errors.
❓ selector
advanced1:30remaining
Which selector is targeted by this Sass mixin usage?
Given this Sass code, which CSS selector will the styles apply to?
@mixin user-select($value) {
-webkit-user-select: $value;
-moz-user-select: $value;
-ms-user-select: $value;
user-select: $value;
}
button {
@include user-select(none);
}SASS
@mixin user-select($value) { -webkit-user-select: $value; -moz-user-select: $value; -ms-user-select: $value; user-select: $value; } button { @include user-select(none); }
Attempts:
2 left
💡 Hint
Look at the selector before the mixin usage.
✗ Incorrect
The styles apply to all
❓ layout
advanced2:00remaining
How does this vendor prefix mixin affect layout rendering?
Consider this Sass mixin and usage:
What visual effect will the container have?
@mixin flex-center {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
justify-content: center;
align-items: center;
}
.container {
@include flex-center;
height: 200px;
}What visual effect will the container have?
SASS
@mixin flex-center { display: -webkit-box; display: -ms-flexbox; display: flex; justify-content: center; align-items: center; } .container { @include flex-center; height: 200px; }
Attempts:
2 left
💡 Hint
Think about what flexbox centering does.
✗ Incorrect
The mixin sets display to flex with vendor prefixes and centers children horizontally and vertically, so children appear centered inside the 200px tall container.
❓ accessibility
expert2:30remaining
Which vendor prefix mixin usage best supports accessibility for focus outlines?
Which Sass mixin usage ensures consistent focus outlines across browsers for accessibility?
Choose the correct usage:
@mixin focus-outline($color) {
outline: 2px solid $color;
outline-offset: 2px;
-webkit-outline-offset: 2px;
}Choose the correct usage:
SASS
@mixin focus-outline($color) { outline: 2px solid $color; outline-offset: 2px; -webkit-outline-offset: 2px; } input:focus { @include focus-outline(blue); }
Attempts:
2 left
💡 Hint
Focus outlines should appear only when keyboard focusing, not on hover.
✗ Incorrect
Using :focus-visible applies outlines only when the element is focused via keyboard or assistive technology, improving accessibility by avoiding outlines on mouse clicks.