Changing border color in mat-form-field

前端 未结 8 1491
猫巷女王i
猫巷女王i 2020-12-14 22:59

I am using angular material mat-form-field. I have a dark background, and therefore am trying to change the border of the form-field to white. But I am not able

8条回答
  •  星月不相逢
    2020-12-14 23:40

    remove boder and add box-shadow :

    ::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline-end {
            border-radius: 50% !important;
            border: none;
            border-left: none;
        }
        ::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline-start {
            border-radius: 1px !important;
            border: none;
            border-right: none;
        }
        ::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline-gap {
            border-radius: 1px !important;
            border-bottom: none;
        }
        
        ::ng-deep.mat-form-field-appearance-outline .mat-form-field-outline {
            box-shadow: -5px -5px 20px #fff, 5px 5px 20px #babecc;
            border-radius: 15px;
        }
    

提交回复
热议问题