It's easy to set a left margin/padding on the Angular Material Datepicker value just adding padding-left: xx on the input's css:
But is it possible to add left margin to the datepicker's placeholder?
I would like to have a bigger margin so that the validation symbol does not hide the placeholder's text:

In order to add left margin to datepicker placeholder you need to add the following code in your css
<mat-form-field class="my-class">
::ng-deep .my-class .mat-form-field-label{
padding-left: 20px;
}
Note: Without using ::ng-deep your padding left will not have any effect not even for 10 or 15px.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With