Bootstrap button - remove outline on Chrome OS X

前端 未结 16 1844
后悔当初
后悔当初 2021-02-01 12:31

I am looking to achieve this: http://getbootstrap.com/javascript/#popovers-examples - scroll to the \"live Demo\" and hit the red popover button, in Chrome on OS X.... It\'s per

相关标签:
16条回答
  • 2021-02-01 12:47

    This will remove it - short and clean:

    .btn {
        outline: none !important;
    }
    
    0 讨论(0)
  • 2021-02-01 12:48

    you can put this tag into your html.

    <button class='btn btn-primary' onfocus='this.blur'>
         Button Text
    </button>
    

    I used on focus because onclick still displayed the glow for a microsecond and made a horrible looking flash in terms of using it. This seemed to get rid after all the css methods failed.

    0 讨论(0)
  • 2021-02-01 12:49

    Search and replace

    outline: thin dotted;
    outline: 5px auto -webkit-focus-ring-color;
    

    Replace to

    outline: 0;
    
    0 讨论(0)
  • 2021-02-01 12:51

    With scss:

    $btn-focus-box-shadow: none!important;
    
    0 讨论(0)
  • 2021-02-01 12:51

    That CSS goes from this file "tab-focus.less" in mixins folder (it could be difficult to find, because mixins are not shown at chrome dev-tools). So you should edit this:

    // WebKit-style focus 
    
    .tab-focus() {
          // Default
          outline: thin dotted;
          // WebKit
          outline: 5px auto -webkit-focus-ring-color;
          outline-offset: -2px;
        }
    
    0 讨论(0)
  • 2021-02-01 12:56

    In the mixins of the Bootstrap sources Sass files, remove all $border references (not in the outline variant).

    @mixin button-variant($color, $background, $border){ 
    $active-background: darken($background, 10%);
    //$active-border: darken($border, 12%);    
      color: $color;
      background-color: $background;
      //border-color: $border;
      @include box-shadow($btn-box-shadow);
      [...]
    }
    

    Or simply code you own _customButton.scss mixin.

    0 讨论(0)
提交回复
热议问题