【问题标题】:How to reduce the height of the MCD based angular material input components with "outlined" appearance (>= Angular 15)如何降低具有“轮廓”外观(>= Angular 15)的基于 MCD 的角度材料输入组件的高度
【发布时间】:2023-02-05 16:48:14
【问题描述】:
标签:
css
angular
angular-material
mdc-components
【解决方案1】:
如果您的 matInput 包含在 mat-grid-list 中,您可以使用此类:
/* low-list-row is a class created to reduce a mat-grid-list form density:
/* Pay attention: it removes the mat-hint*/
::ng-deep ._low-list-row .mat-form-field-subscript-wrapper {
visibility: hidden !important;
}
::ng-deep ._low-list-row .mat-form-field-wrapper {
padding-bottom: 0px !important;
}
::ng-deep ._low-list-row .mat-form-field-underline {
bottom: 0.25em !important;
}
::ng-deep ._low-list-row .mat-grid-tile {
height: 50px !important;
}
::ng-deep ._low-list-row {
height: 50px !important;
}
它使用已弃用的 ::ng-deep 方法,但我不知道其他方法
如果它不包含在网格列表中,您可以利用它的一部分