I was surprised that Twitter Bootstrap does not have media queries for building an adequate website version for mobile portrait screens.
A tricky thing is to define “mobile portrait” width. Previously most phones had 320px
screen width, but currently most advisable is to target devices narrower than 375px
.
I need at least .col-xxs-*
classes with a breakpoint at 375px
screen width, similar to .col-xs-*
. This can be CSS or SCSS code. I’m using Bootstrap-4-alpha, hope solution will work for Bootstrap-3 too.
4
Answers
Some bootstrap forks are providing additional breakpoints in a pretty solid manner. This one seems to be maintained regularly and works fine for me:
SCSS: https://gist.github.com/Jakobud/c057577daddbde4dd709
LESS: https://gist.github.com/wdollar/135ec3c80faaf5a821b0
You didn’t specify which iPhone you’re designing for, so here are most of them to help get you started
In Bootstrap 4 you can just add a new breakpoint by editing the
$grid-breakpoints
-variable. Originally it is:By changing it to
you would add a new breakpoint
xxs
. But I would recommend a 2-sign-identifier, something likems
for “medium-small”:In TWBS3 it’s not that easy – there you will have to hack the code.
You can add a new breakpoint to BS 4 by changing the
$grid-breakpoints
and$container-max-widths
variables with SASS.http://codeply.com/go/mPS4Yros4U
Update 2018: Now that the
xs-
infix has been removed in Bootstrap 4, adding a new smaller xxs breakpoint means that this lowest breakpoint has no infix. For example:Notes on customizing Bootstrap using SASS, from the docs…