如何更改 Ngb-Datepicker 导航箭头中的边框

问题描述

enter image description here

嗨,我想消除点击按钮后显示的蓝色边框,我已经尝试使用

::ng-deep{
  .ngb-dp-arrow > button:active {
   border: none !important;
}

但似乎没有任何效果,我已经用这种方法改变了雪佛龙的颜色,所以我将我的 css 放在正确的位置(组件本身)

复制链接https://stackblitz.com/edit/angular-er2bdu?file=src%2Fapp%2Fdatepicker-popup.css

解决方法

您应该能够使用以下 CSS 来移除边框:

::ng-deep .ngb-dp-arrow-btn:focus {
  outline: 0 !important; // remove the darker blue border
  box-shadow: none !important; // remove the light blue border
}

有与该:focus伪选择器出现2个边界:

  • 深蓝色边框 - 可以通过将 outline 设置为 0 来移除
  • 浅蓝色框边框 - 可以通过将 box-shadow 设置为 none 来移除

有关工作演示,请参阅 this Stackblitz