Skip to content

Commit 5bf0fa3

Browse files
committed
refactor(button): add some touches to the expanded fab
1 parent ab0c9e3 commit 5bf0fa3

File tree

2 files changed

+36
-20
lines changed

2 files changed

+36
-20
lines changed

projects/igniteui-angular/src/lib/core/styles/components/button/_button-theme.scss

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@
429429
@mixin igx-button($theme) {
430430
@include igx-root-css-vars($theme);
431431

432+
$left: if-ltr(left, right);
433+
$right: if-ltr(right, left);
432434
$button-border: 1px solid transparent;
433435
$button-width: rem(88px);
434436

@@ -514,9 +516,9 @@
514516

515517

516518
$button-floating-padding: (
517-
comfortable: rem(8px) rem(20px) rem(8px) rem(12px),
518-
cosy: rem(4px) rem(16px) rem(4px) rem(8px),
519-
compact: 0 rem(12px) 0 rem(4px)
519+
comfortable: rem(8px) rem(16px),
520+
cosy: rem(4px) rem(12px),
521+
compact: 0 rem(8px)
520522
);
521523

522524
$button-floating-size: (
@@ -766,26 +768,33 @@
766768
igx-icon {
767769
display: inline-flex;
768770
order: -1;
769-
margin: 7px 0;
770-
padding-left: 4px;
771+
margin: rem(8px) 0;
771772
}
772773

773774
* + igx-icon {
774775
margin: 0;
775-
margin-right: 12px;
776+
margin-#{$right}: rem(12px);
776777
}
777778
}
778779

779780
%igx-button--fab-cosy {
780781
padding: map-get($button-floating-padding, 'cosy');
781782
min-width: map-get($button-floating-size, 'cosy');
782783
min-height: map-get($button-floating-size, 'cosy');
784+
785+
* + igx-icon {
786+
margin-#{$right}: rem(8px);
787+
}
783788
}
784789

785790
%igx-button--fab-compact {
786791
padding: map-get($button-floating-padding, 'compact');
787792
min-width: map-get($button-floating-size, 'compact');
788793
min-height: map-get($button-floating-size, 'compact');
794+
795+
* + igx-icon {
796+
margin-#{$right}: rem(4px);
797+
}
789798
}
790799

791800
%igx-button--icon {
@@ -863,15 +872,11 @@
863872
}
864873

865874
%igx-button--fab {
866-
p,
867-
span,
868-
div
869-
{
870-
font-size: rem(12px);
871-
letter-spacing: rem(.75px);
872-
text-transform: uppercase;
873-
font-weight: 700;
874-
margin: 0;
875+
p, span, div {
876+
@include igx-type-style($type-scale, $text) {
877+
text-align: center;
878+
margin: 0;
879+
}
875880
}
876881
}
877882
}

src/app/button/button.sample.html

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h4 class="sample-title">Flat Buttons</h4>
2424
</div>
2525
</div>
2626
</article>
27-
27+
2828
<article class="sample-column">
2929
<h4 class="sample-title">Raised Buttons</h4>
3030
<div class="buttons-sample">
@@ -48,7 +48,7 @@ <h4 class="sample-title">Raised Buttons</h4>
4848
</div>
4949
</div>
5050
</article>
51-
51+
5252
<article class="sample-column">
5353
<h4 class="sample-title">Outlined Buttons</h4>
5454
<div class="buttons-sample">
@@ -72,7 +72,7 @@ <h4 class="sample-title">Outlined Buttons</h4>
7272
</div>
7373
</div>
7474
</article>
75-
75+
7676
<article class="sample-column">
7777
<h4 class="sample-title">Floating Action Buttons</h4>
7878
<div class="buttons-sample">
@@ -108,7 +108,7 @@ <h4 class="sample-title">Floating Action Buttons</h4>
108108
</div>
109109
</div>
110110
</article>
111-
111+
112112
<article class="sample-column">
113113
<h4 class="sample-title">Icon Buttons</h4>
114114
<div class="buttons-sample">
@@ -179,7 +179,18 @@ <h4 class="sample-title">Buttons based on Display Density</h4>
179179
</div>
180180
<div class="button-sample">
181181
<button igxRipple igxButton="fab" [displayDensity]="density">
182-
<igx-icon fontSet="material" >favorite</igx-icon>
182+
<igx-icon fontSet="material">favorite</igx-icon>
183+
</button>
184+
</div>
185+
<div class="button-sample">
186+
<button igxRipple igxButton="fab" [displayDensity]="density">
187+
<span>Favorite</span>
188+
<igx-icon fontSet="material">favorite</igx-icon>
189+
</button>
190+
</div>
191+
<div class="button-sample">
192+
<button igxRipple igxButton="fab" [displayDensity]="density">
193+
<span>Favorite</span>
183194
</button>
184195
</div>
185196
</div>

0 commit comments

Comments
 (0)