Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reducing line height in angular material tree

I am using a angular tree material to display JSON data, I am unsatisfied by the amount of white spacing there is between lines. I have tried playing with mat-tree-node.line-height in the css with zero changes. How can I reduce all this vertical white space?

enter image description here

like image 431
Learning is a mess Avatar asked Jul 23 '18 16:07

Learning is a mess


2 Answers

Simply by overriding their css:

.mat-tree-node { min-height: 30px }
like image 187
Alexandre Annic Avatar answered Nov 09 '22 10:11

Alexandre Annic


The only working way I found with angular 8 on a nested element (and nested tree) is

.mat-tree-node {
  min-height: 1.2em !important;
  height: 1.2em;
}
like image 6
Pipo Avatar answered Nov 09 '22 10:11

Pipo