Change Bootstrap input focus blue glow

后端 未结 19 2164
抹茶落季
抹茶落季 2020-11-30 16:53

Does anyone know the how to change Bootstrap\'s input:focus? The blue glow that shows up when you click on an input field?

19条回答
  •  旧巷少年郎
    2020-11-30 17:11

    In Bootstrap 4, if you compile SASS by yourself, you can change the following variables to control the styling of the focus shadow:

    $input-btn-focus-width:       .2rem !default;
    $input-btn-focus-color:       rgba($component-active-bg, .25) !default;
    $input-btn-focus-box-shadow:  0 0 0 $input-btn-focus-width $input-btn-focus-color !default;
    

    Note: as of Bootstrap 4.1, the $input-btn-focus-color and $input-btn-focus-box-shadow variables are used only for input elements, but not for buttons. The focus shadow for buttons is hardcoded as box-shadow: 0 0 0 $btn-focus-width rgba($border, .5);, so you can only control the shadow width via the $input-btn-focus-width variable.

提交回复
热议问题