I want my buttons showing left- and right arrow and NOW text to be as small as possible. How do I do that?
<div ng-controller="DateCtrl" layout="row" flex>
<md-datepicker ng-model="activeDate" md-placeholder="Enter date" ng-change="changeDate()"></md-datepicker>
<div>
<md-button class="md-raised" ng-click="prev()"><</md-button>
<md-button class="md-raised" ng-click="changeToday()">NOW</md-button>
<md-button class="md-raised" ng-click="next()">></md-button>
</div>
</div>
With the current solution the buttons will be arranged as if they were in a layout="column"
, that is vertically.
Before I dig into this CSS-style, I just wanted to check if there is a preferred Angular-Material way of doing this?
If you are using md-icon-button, then material sets a width, height and padding for the icon:
so you need to override it ("auto" works well if you want the button to fit the parent)
Add the following to your styles:
Alternatively, use a custom class:
Or, in Angular Material 2:
I used this style for making a smaller md-button
I found that font-size must be on md-icon, and I needed a min-height on both the md-button and md-icon tags.
Try the following class in your styles. You can adjust the pixel depending on how big/small you want the button to be.
I'm using https://github.com/angular/material2
this creates smaller mini-fab.