Skip to content

Commit 32f8315

Browse files
desig9steinMPopovkdinev
authored
fix(button): Update the FAB button to support multiple icons from both sides. (#9269)
Closes #9238 Co-authored-by: MPopov <[email protected]> Co-authored-by: Konstantin Dinev <[email protected]>
1 parent 248419d commit 32f8315

File tree

2 files changed

+17
-24
lines changed

2 files changed

+17
-24
lines changed

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

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -820,36 +820,32 @@
820820
}
821821
}
822822

823-
igx-icon {
824-
display: inline-flex;
825-
order: -1;
826-
margin: rem(8px) 0;
827-
}
828-
829-
* + igx-icon {
830-
margin: 0;
831-
margin-#{$right}: rem(12px);
832-
}
823+
@include _icon-w-margin(
824+
map-get($icon-in-button-margin, 'comfortable'),
825+
$left
826+
);
833827
}
834828

835829
%igx-button--fab-cosy {
836830
padding: map-get($button-floating-padding, 'cosy');
837831
min-width: map-get($button-floating-size, 'cosy');
838832
min-height: map-get($button-floating-size, 'cosy');
839833

840-
* + igx-icon {
841-
margin-#{$right}: rem(8px);
842-
}
834+
@include _icon-w-margin(
835+
map-get($icon-in-button-margin, 'cosy'),
836+
$left
837+
);
843838
}
844839

845840
%igx-button--fab-compact {
846841
padding: map-get($button-floating-padding, 'compact');
847842
min-width: map-get($button-floating-size, 'compact');
848843
min-height: map-get($button-floating-size, 'compact');
849844

850-
* + igx-icon {
851-
margin-#{$right}: rem(4px);
852-
}
845+
@include _icon-w-margin(
846+
map-get($icon-in-button-margin, 'compact'),
847+
$left
848+
);
853849
}
854850

855851
%igx-button--icon {
@@ -932,13 +928,9 @@
932928
}
933929

934930
%igx-button--fab {
935-
p,
936-
span,
937-
div {
938-
@include igx-type-style($type-scale, $text) {
939-
text-align: center;
940-
margin: 0;
941-
}
931+
@include igx-type-style($type-scale, $text) {
932+
text-align: center;
933+
margin: 0;
942934
}
943935
}
944936
}

src/app/button/button.sample.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ <h4 class="sample-title">Buttons based on Display Density</h4>
172172
</button>
173173
</div>
174174
<div class="button-sample">
175-
<button igxRipple igxButton="fab" igxRipple [displayDensity]="density">
175+
<button igxRipple igxButton="fab" [displayDensity]="density">
176+
<span>FAB</span>
176177
<igx-icon>face</igx-icon>
177178
</button>
178179
</div>

0 commit comments

Comments
 (0)