Bootstrap 4 Change Breakpoints

前端 未结 3 1180
暗喜
暗喜 2020-11-29 02:04

I have an application where the design calls for a 1280 breakpoint from desktop to tablet, or, xl to lg respectively. However, Bootstrap itself has the xl breakpoint at 1200

3条回答
  •  伪装坚强ぢ
    2020-11-29 02:37

    Changing the $grid-breakpoints variable will work fine. Remember that you must import /bootstrap or the bootstrap/variables in the custom.scss, and then @import bootstrap after.

    For example:

    $grid-breakpoints: (
      xs: 0,
      sm: 600px,
      md: 800px,
      lg: 1000px,
      xl: 1280px
    );
    

    Demo: https://codeply.com/go/MlIRhbJYGj

    Also see: How to extend/modify (customize) Bootstrap 4 with SASS

提交回复
热议问题