Open ameotoko opened 1 year ago
Very true, most people will be working from smallest screen (mobile first), so unless you use mobileFirst: true
, the responsive array by default will expect largest fist.
But by using mobileFirst: true
setting, responsive array and any other parent settings are hit mobile first and up in any set responsive
array settings.
Defining mobileFirst: true
doesn't reverse your current responsive
settings array, you have to rewrite your responsive
array so smallest breakpoint
setting is first, and then wider sizes for each following breakpoint
setting in array.
Also another querky thing to be aware of, is that if you are using slidesToScroll
on each breakpoint, be aware that if you are using swipeToSlide: true
in your settings or breakpoint setting, this will default slidesToScroll
to 1
.
This caught me out. But makes sense as swipeToSlide: true
only allows you to swipe 1
slide at a single swipe, which could be handy in some scenarios.
The docs on
responsive
andmobileFirst
options are not 100% clearly phrased. It is important to understand, that breakpoints are applied in order from largest to smallest, which can be counterintuitive for some designers. In the example from the docs, the "Normal settings" will be applied for screen width larger than 1024:If you're writing your CSS "mobile first" according to CSS best practices, you might wonder why your
responsive
settings don't work. That's whatmobileFirst
option is for. If you setmobileFirst: true
, then the order ofresponsive
settings is reversed, and "normal" options are applied for the smallest screen width, and then responsive in ascending order.