This is how the chips are stacked right now:
The space on the left is clearly less then on the right. How can i center the chips so that the margins on both sides are even? I've tried using custom css classes with text-align: center
and vertical-align:middle
but none of that worked.
EDIT: For reference here is the code:
<mat-form-field class = "chiplist" *ngIf="advancedFilterList.length > 0">
<mat-chip-list class="mat-chip-list-stacked" aria-orientation="vertical">
<mat-chip *ngFor="let advancedFilter of advancedFilterList" [selectable]="selectable"
[removable]="removable" (removed)="remove(advancedFilter)" (click)="changeUnitSymbolAndPopulateFieldsWithSelectedFilterData(advancedFilter)">
<mat-icon matChipRemove>cancel</mat-icon>
<div [innerHTML]="getFullFilterDescription(advancedFilter)"></div>
</mat-chip>
</mat-chip-list>
</mat-form-field>
You should delete the class "mat-chip-list-stacked", since it has a width of 100%, so you would already see the mat-chip centered. If you want to add CSS, create your own class and add the corresponding styles
Example: mat-chip center