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.