P粉0927785852023-08-19 11:02:21
To change the size of the checkbox, add the following CSS code in styles.scss
:
.mdc-checkbox__background { width: 1.5rem !important; height: 1.5rem !important; }
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
:
.mdc-checkbox__background { width: 1.5rem !important; height: 1.5rem !important; top: 50% !important; /* 添加 */ left: 50% !important; /* 添加 */ transform: translate(-50%, -50%) !important; /* 添加 */ }
Please refer to Real-time Demonstration.