-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(button): add md-icon-button styling. #206
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,28 @@ | |
@include md-fab($md-mini-fab-size, $md-mini-fab-padding) | ||
} | ||
|
||
[md-icon-button] { | ||
@extend %md-button-base; | ||
|
||
min-width: 0; | ||
padding: 0; | ||
|
||
width: $md-icon-button-size; | ||
height: $md-icon-button-size; | ||
|
||
line-height: $md-icon-button-line-height; | ||
border-radius: $md-icon-button-border-radius; | ||
|
||
&.md-button-focus { | ||
background-color: md-color($md-foreground, base, 0.12); | ||
@include md-button-theme('background-color', 0.12); | ||
} | ||
|
||
.md-button-wrapper > * { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does this need a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is needed to align the first level child items of the wrapper in the middle (correctly to the line-height) |
||
vertical-align: middle; | ||
} | ||
} | ||
|
||
// Applies a clearer border for high-contrast mode (a11y) | ||
@media screen and (-ms-high-contrast: active) { | ||
.md-raised-button, .md-fab, .md-mini-fab { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,20 @@ | |
</button> | ||
</section> | ||
|
||
<section> | ||
<button md-icon-button color="primary"> | ||
<i class="material-icons md-24">menu</i> | ||
</button> | ||
|
||
<button md-icon-button color="accent"> | ||
<i class="material-icons md-24">favorite</i> | ||
</button> | ||
|
||
<button md-icon-button> | ||
<i class="material-icons md-24">more_vert</i> | ||
</button> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add an icon-button to the disabled section at the bottom as well? It will ensure disabled styles are applied properly to this type of button over time. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, great idea. - Done |
||
</section> | ||
|
||
<section> | ||
<div> | ||
<span>isDisabled: {{isDisabled}}</span> | ||
|
@@ -57,5 +71,9 @@ | |
<button md-mini-fab [disabled]="isDisabled"> | ||
<i class="material-icons md-24">check</i> | ||
</button> | ||
|
||
<button md-icon-button color="accent" [disabled]="isDisabled"> | ||
<i class="material-icons md-24">favorite</i> | ||
</button> | ||
</section> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this extends the base button rather than a fab, it will likely need styling for its disabled state. Is this covered somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is already covered by the default button base.