代码之家  ›  专栏  ›  技术社区  ›  farahm

离子更改禁用按钮的字体颜色

  •  0
  • farahm  · 技术社区  · 6 年前

    如何更改禁用按钮的字体颜色?

    我有:

     <ion-col col-1><button class='buttoncell abc noactualbutton' ion-button [disabled]="true" [color]="white">{{row[8]}}</button></ion-col>
    

    SCSS:

       .noactualbutton[disabled]{
          color: rgb(255, 255, 255) !important;
        }
    

    但是,它仍然是“白色”,但它仍然是灰色的…

    1 回复  |  直到 6 年前
        1
  •  1
  •   Berk Akkerman    6 年前

    禁用按钮时,不透明度自动设置为0.4。当禁用样式时,可以将样式设置为按钮,如下所示:

    .noactualbutton:disabled, noactualbutton[disabled]{
          color: white;
          opacity: 1;
          background: #b3b3b3;
      }