Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set font size of Angular Material Tooltip

I am very new to web development, and I cannot figure out how to solve the following issue, although it may be very easy.

I am using Angular 4 and Angular Material to implement tooltips like this:

<div mdTooltip="tooltip text" mdTooltipPosition="above">   <span>Show tooltip</span> </div> 

I would like to make the font size of the tooltip text bigger. However, I did not manage to find how to do this in the Angular Material documentation, neither searching in the web. Does anyone have any idea on how to do this? Thanks.

like image 676
GLR Avatar asked Jun 16 '17 10:06

GLR


People also ask

How do I increase font size in tooltip?

You can change the variable $ tooltip-inner-font-size and assign it a new value. You will find this variable in src/mdb/scss/free/_variables. scss . Remember that this will change the text size of all tooltips.

How do I change font size on mat tooltip?

You can fix this by adding a . mat-tooltip css declaration in you main styles file and change the font size there. You need to set ! important on the font size otherwise it won't show up.

How do you style a material UI tooltip?

To style React Material UI tooltip, we can use the makeStyles function. We call makeStyles with a function that returns an object that has some classes with some styles. We set the background color and the color in the classes.


1 Answers

You can fix this by adding a .mat-tooltip css declaration in you main styles file and change the font size there. You need to set !important on the font size otherwise it won't show up.

like image 76
Dean Chalk Avatar answered Sep 22 '22 04:09

Dean Chalk