Reduce the gutter (default 30px) on smaller devices in Bootstrap3?

后端 未结 5 922
天涯浪人
天涯浪人 2020-12-01 01:50

In bootstrap 3 the gutter is defined as 30px (15px on each side of a column). The issue I\'m running is that, for example if I shrink my screen down to be tiny, the gutters

5条回答
  •  囚心锁ツ
    2020-12-01 01:58

    I tried to rewrite Bootstrap mixin in order to have half of the normal grid-gutter for the XS width. Seems work fine.

    .make-xs-column(@columns; @gutter: @grid-gutter-width) {   
        @media(max-width: @screen-xs-min) {
            padding-left:  (@gutter / 4);
            padding-right: (@gutter / 4);
        };
    }
    .make-row(@gutter: @grid-gutter-width) {
        @media(max-width: @screen-xs-min) {
            margin-left:  (@gutter / -4);
            margin-right: (@gutter / -4);
        }
    }
    
    .container-fixed() {
        @media(max-width: @screen-xs-min) {
            padding-left:  (@grid-gutter-width / 4);
            padding-right: (@grid-gutter-width / 4);
        }
    }
    

提交回复
热议问题