I'm working on customizing the appearance of a mat-checkbox (material2) to meet the following specifications:
Always display a black border (#000000), regardless of whether the checkbox is checked or not
When the checkbox is checked, show a white tick on a teal background with the black border still visible
When unchecked, the inside of the checkbox should be an off-white color (#dddddd)
Currently, I've managed to set the border color, but it disappears when the checkbox is checked behind the teal color
I can also set the unchecked background color, but then the black border vanishes. If I remove this setting, the border shows up but the background color is incorrect.
The SCSS properties I have set are as follows:
::ng-deep .mat-checkbox .mat-checkbox-frame {
border-color: mat-color($darkPrimary, darker); //black
}
::ng-deep .mat-checkbox-background {
background-color: mat-color($darkPrimary, 200); //off-white
}
It appears that whatever background color I choose overrides the border style. Additionally, when the checkbox state changes, the black border briefly reappears and then disappears again. How can I achieve these requirements?