Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular material badge position

I am trying implement angular material badge in my menu list.

Is it possible to position the badge in the center of list item?

Official document says : "By default, the badge will be placed above after. The direction can be changed by defining the attribute matBadgePosition follow by above|below and before|after."

But I need exclude this above|below position option

enter image description here

Or at the least if it is possible to set visible the entire badge inside the list-item

like image 785
Ante Ereš Avatar asked Aug 24 '18 13:08

Ante Ereš


People also ask

How do I change my mat badge position?

Changing mat Badge Position By default, material badge will be displayed on top right corner of the element. We can change the position of mat Badge by using matBadgePosition input.

What is Badge component?

A badge is a visual indicator for numeric values such as tallies and scores. ExamplesCodeUsage.

How do I make the mat icon smaller?

Since Angular Material uses 'Material Icons' Font-Family, the icon size depends on font-size. Therefore, if you want to modify the size of the icon then you change its font-size in your CSS file. You have to set the width and height too.


1 Answers

Check this blitzy

Solved using CSS

.mat-badge-medium.mat-badge-above .mat-badge-content {
    top: -3px;
}
like image 80
dota2pro Avatar answered Sep 23 '22 19:09

dota2pro