I'm very new to angular-material and I'm using some md-button
directives. As I'm coming from Bootstrap world, I'm searching for a way to have different sizes for md-button
s. Something like btn-xs
and btn-sm
classes in Bootstrap.
I created a class md-button-xs
and tried to set size of button using this class with no success. I even tried to resize the button using developer options in Google Chrome but that didn't work too.
How can I have different sizes for md-button
and other Angular Material components?
We're all (well kind of) new to Angular Material. This serves as my disclaimer to my answer.
I never spent much time with twitter bootstrap, but I can tell you that specifying sizes is probably not as important in the realm of Angular Material.
Why not mess around with the buttons in the buttons demo page? Or is there something more specific you are looking to do that you need help with? https://material.angularjs.org/latest/#/demo/material.components.button
I messed with it a bit for you! Pretty simple stuff once you get going. http://codepen.io/qvazzler/pen/jPgbQO
<md-button flex="15">{{title1}} (Not much)</md-button>
<md-button flex="15" md-no-ink="" class="md-primary">Primary (Not much either)</md-button>
<md-button flex="33" ng-disabled="true" class="md-primary">Disabled (More space for me!)</md-button>
<md-button flex class="md-warn">{{title4}} (I'll have what's left)</md-button>
Good luck!
Post written with reference to Angular Material version 0.10.1. If you are using a newer version and you can't get familiar results, use the site to change version after browsing to any of my links to figure out what's wrong. And there's always the changelog.
Simply you can do your own if you want, for example i did that:
.material-cust-large-button {
width: 300px;
height: 70px;
padding-top: 13px;
}
.material-cust-medium-button {
width: 150px;
height: 70px;
padding-top: 13px;
}
And in html:
<md-button class="md-raised md-primary material-cust-large-button">text</md-button>
<md-button ui-sref="..." class="md-raised md-primary material-cust-medium-button">text</md-button>
And it works as i expected:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With