Complete the code to define a mixin named 'respond' that takes one parameter.
@mixin [1]($breakpoint) {
@media (min-width: $breakpoint) {
@content;
}
}The mixin name should be 'respond' to match the usage pattern for responsive breakpoints.
Complete the code to use the 'respond' mixin with a breakpoint variable.
.container {
@include respond([1]) {
width: 80%;
}
}The mixin expects a variable representing the breakpoint, so '$tablet' is correct.
Fix the error in the mixin to correctly apply styles for max-width breakpoints.
@mixin respond-max($breakpoint) { @media ([1]-width: $breakpoint) { @content; } }
The correct media feature for maximum width is 'max-width'.
Fill both blanks to create a mixin that applies styles between two breakpoints.
@mixin respond-between($min, $max) {
@media ([1]-width: $min) and ([2]-width: $max) {
@content;
}
}The media query should use 'min-width' for the lower limit and 'max-width' for the upper limit.
Fill all three blanks to create a map of breakpoints and use it in a mixin.
$breakpoints: ( mobile: [1], tablet: [2], desktop: [3] ); @mixin respond-map($device) { @media (min-width: map-get($breakpoints, $device)) { @content; } }
The map defines common device widths: mobile at 320px, tablet at 768px, and desktop at 1024px.