Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
WIP Tweak icon margin differently for flat vs. contained
Browse files Browse the repository at this point in the history
  • Loading branch information
CnEY?! committed Mar 21, 2018
1 parent d02d9d1 commit 5c84f6c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions packages/mdc-button/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
}

@mixin mdc-button__icon_ {
@include mdc-rtl-reflexive-box(margin, right, 8px);
@include mdc-button__icon-margin_(-2px);

display: inline-block;
width: 18px;
Expand All @@ -142,8 +142,9 @@
vertical-align: middle;
}

@mixin mdc-button__icon-contained_ {
@include mdc-rtl-reflexive-property(margin, -4px, 8px);
@mixin mdc-button__icon-margin_($margin) {
// Sets margin on the side of the icon nearest the button edge to the given value; other side has constant margin
@include mdc-rtl-reflexive-property(margin, $margin, $mdc-button-icon-label-margin);
}

@mixin mdc-button--stroked_() {
Expand Down
1 change: 1 addition & 0 deletions packages/mdc-button/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
$mdc-button-height: 36px;
$mdc-button-horizontal-padding: 8px;
$mdc-button-contained-horizontal-padding: 16px;
$mdc-button-icon-label-margin: 8px;
$mdc-dense-button-height: 32px;
4 changes: 2 additions & 2 deletions packages/mdc-button/mdc-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
.mdc-button--raised,
.mdc-button--stroked {
.mdc-button__icon {
// Icons inside contained buttons have different styles due to increased button padding
@include mdc-button__icon-contained_;
// Contained buttons have a different icon-side margin due to increased overall button padding
@include mdc-button__icon-margin_(-4px);
}
}

Expand Down

0 comments on commit 5c84f6c

Please sign in to comment.