docs/content/CSS/button.md
@ngdoc content @name button @description
Below is a snapshot of the AngularJS Material button component demos with the default themes and standard options:
The base CSS class for all <md-button> components is .md-button:
When defining custom CSS overrides, developers should create their own CSS class. For example, to define a .btn1 override to md-button use:
All AngularJS Material components have specific CSS rules constructed using the theme name and theme-class overrides. For the Default theme, however, these rules are added to the components styles using the .md-default-theme class. If, however, you have configured a custom theme called companyX that is NOT the default theme, then any CSS overrides must use fully-specified classname. For <md-button> the fully-specified classname will be .md-button.md-companyX-theme.btn1.
.md-button:not([disabled]):hover { background-color: rgba(158, 158, 158, 0.2); }
.md-button[disabled] { color : rgba(0, 0, 0, 0.26); background-color: transparent; } </hljs>
.btn1:not([disabled]):hover { background-color: rgba(107, 103, 91, 0.96); color: white; }
.btn1[disabled] { color : rgb(187, 187, 187); background-color: rgba(230, 230, 229, 0.96); } </hljs>
Add the .md-raised class to create a raised button:
Add the .md-cornered class to create a button with corners:
Add the .md-fab class in order to create a floating action button (aka FAB):
Add the .md-mini class in order to create small, mini-FAB buttons:
Create icon buttons by adding the .md-icon-button class and the <md-icon ...> component:
Here is another example of a button with font icons:
<hljs lang="html"> <md-button> <md-icon md-font-icon="icon-home" ng-style="{color: 'green', 'font-size':'36px', height:'36px'}" > </md-icon> </md-button> </hljs>Using the customization approaches documented above, we can easily create a mdButtonGroup:
<hljs lang="html"> <section layout="row" layout-align="center center"> <md-button class="groupX left">Apple</md-button> <md-button class="groupX middle">Samsung</md-button> <md-button class="groupX middle">Sony</md-button> <md-button class="groupX right">B&O</md-button> </section> </hljs> <hljs lang="css"> .groupX { font-size: 16px; margin: 20px 0; padding: 3px 15px 3px 15px; color: rgb(49, 46, 46); background-color: rgba(224, 224, 224, 0.96); text-transform: none; font-weight: 400; min-width:100px; }.md-button.left { border-radius: 10px 0 0 10px; }
.md-button.middle { border-radius: 0; border-left: 1px solid rgba(230, 230, 230, 0.96); border-right: 1px solid rgba(230, 230, 230, 0.96); }
.md-button.right { border-radius: 0 10px 10px 0; }
.md-button:not([disabled]):hover { background-color: rgba(193, 193, 193, 0.96); color: rgba(44, 65, 164, 0.96); transition: 0.3s; } </hljs>