Angular 16: How do I change the size of an Angular Material checkbox (MDC)?
P粉254077747
2023-08-18 11:42:41
<p>In Material, which is now considered legacy, I can set the size of the checkbox as follows: </p>
<pre class="brush:php;toolbar:false;">.mat-checkbox-frame {
width: 1.5rem;
}</pre>
<p>How can I achieve the same effect in MDC? </p>
To change the size of the checkbox, add the following CSS code in
styles.scss
:However, if you want to use the default ripple effect, this is only half the solution. Now you also need to align the checkbox so that it fits perfectly within the circle of the ripple effect. Please add the following CSS code in
styles.scss
:Please refer to Real-time Demonstration.