Getting rid of all the rounded corners in Twitter Bootstrap

后端 未结 16 2360
旧时难觅i
旧时难觅i 2020-12-22 17:07

I love Twitter Bootstrap 2.0 - I love how it\'s such a complete library... but I want to make a global modification for a very boxy-not-round site, which is to get rid of al

相关标签:
16条回答
  • 2020-12-22 17:42
    .btn {
      border-radius:                    0px;
      -webkit-border-radius:            0px;
      -moz-border-radius:               0px;
    }
    

    Or define a mixin and include it wherever you want an unrounded button.

    @mixin btn-round-none {
      border-radius:                    0px;
      -webkit-border-radius:            0px;
      -moz-border-radius:               0px;
    }
    
    .btn.btn_1 {
    @inlude btn-round-none
    }
    
    0 讨论(0)
  • 2020-12-22 17:44
    code,
    kbd,
    pre,
    .img-rounded,
    .img-thumbnail,
    .img-circle,
    .form-control,
    .btn,
    .btn-link,
    .dropdown-menu,
    .list-group-item,
    .input-group-addon,
    .input-group-btn,
    .nav-tabs a,
    .nav-pills a,
    .navbar,
    .navbar-toggle,
    .icon-bar,
    .breadcrumb,
    .pagination,
    .pager *,
    .label,
    .badge,
    .jumbotron,
    .thumbnail,
    .alert,
    .progress,
    .panel,
    .well,
    .modal-content,
    .tooltip-inner,
    .popover,
    .popover-title,
    .carousel-indicators li {
        border-radius:0 !important;
    }
    
    0 讨论(0)
  • 2020-12-22 17:44

    The code posted above by @BrunoS did not work for me,

    * {
      .border-radius(0) !important;
    }
    

    what i used was

    * {
      border-radius: 0 !important;
    }
    

    I hope this helps someone

    0 讨论(0)
  • 2020-12-22 17:48

    I have create another css file and add the following code Not all element are included

    /* Flatten das boostrap */
    .well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid, .panel {
        -moz-box-shadow: none !important;
        -webkit-box-shadow: none !important;
        box-shadow: none !important;
        -webkit-border-radius: 0px !important;
        -moz-border-radius: 0px !important;
        border-radius: 0px !important;
        border-collapse: collapse !important;
        background-image: none !important;
    }
    
    0 讨论(0)
  • 2020-12-22 17:51

    When using Bootstrap >= 3.0 source files (SASS or LESS) you don't have to get rid of the rounded corners on everything if there is just one element that is bugging you, for example, to just get rid of the rounded corners on the navbar, use:

    With SCSS:

    $navbar-border-radius: 0;
    

    With LESS:

    @navbar-border-radius: 0;
    

    However, if you do want to get rid of the rounded corners on everything, you can do what @adamwong246 mentioned and use:

    $baseBorderRadius: 0;
    @baseBorderRadius: 0;
    

    Those two settings are the "root" settings from which the other settings like navbar-border-radius will inherit from unless other values are specified.

    For a list all variables check out the variables.less or variables.scss

    0 讨论(0)
  • 2020-12-22 17:52

    This question is pretty old however it is highly visible on search engines even in Bootstrap 4 related searches. I think it worths to add an answer for disabling the rounded corners, BS4 way.

    In the _variables.scss there are several global modifiers exists to quickly change the stuff such as enabling or disabling flex gird system, rounded corners, gradients etc. :

    $enable-flex:          false !default;
    $enable-rounded:       true !default; // <-- This one
    $enable-shadows:       false !default;
    $enable-gradients:     false !default;
    $enable-transitions:   false !default;
    

    Rounded corners are enabled by default.

    If you prefer compiling the Bootstrap 4 using Sass and your very own _custom.scss like me (or using official customizer), overriding the related variable is enough:

    $enable-rounded : false
    
    0 讨论(0)
提交回复
热议问题