Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit af3ef52

Browse files
topherfangioThomasBurleson
authored andcommitted
fix(chips): Fix styling issues with padding & remove.
Update SCSS to fix: * remove icon jumping to next line on long chips * right padding of chips without a remove icon * location of remove icon in Firefox/Safari fixes #4264. fixes #3276. fixes #2410. closes #4275.
1 parent e22cd6b commit af3ef52

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

src/components/chips/chips.scss

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
$chip-font-size: rem(1.6) !default;
22
$chip-height: rem(3.2) !default;
3-
$chip-padding: 0 rem(0.8) 0 rem(1.2) !default;
3+
$chip-padding: 0 rem(1.2) 0 rem(1.2) !default;
4+
$chip-remove-padding-right: rem(2.2) !default;
5+
$chip-remove-line-height: rem(2.2) !default;
46
$chip-margin: rem(0.8) rem(0.8) 0 0 !default;
57
$chip-wrap-padding: 0 0 rem(0.8) rem(0.3) !default;
68
$chip-delete-icon-size: rem(1.8) !default;
7-
$contact-chip-padding: 0 rem(0.8) 0 0 !default;
9+
$contact-chip-padding: 0 rem(2.5) 0 0 !default;
810
$contact-chip-suggestion-image-height: rem(4.0) !default;
911
$contact-chip-suggestion-margin: rem(0.8) !default;
1012
$contact-chip-name-width: rem(12) !default;
@@ -50,15 +52,21 @@ $contact-chip-name-width: rem(12) !default;
5052
}
5153
.md-chips {
5254
@include pie-clearfix();
55+
5356
display: block;
5457
font-family: $font-family;
5558
font-size: $chip-font-size;
5659
padding: $chip-wrap-padding;
5760
vertical-align: middle;
5861

59-
&:not('.md-readonly') {
62+
&:not(.md-readonly) {
6063
cursor: text;
64+
65+
.md-chip {
66+
padding-right: $chip-remove-padding-right;
67+
}
6168
}
69+
6270
.md-chip {
6371
cursor: default;
6472
border-radius: $chip-height / 2;
@@ -70,6 +78,8 @@ $contact-chip-name-width: rem(12) !default;
7078
float: left;
7179
box-sizing: border-box;
7280
max-width: 100%;
81+
position: relative;
82+
7383
.md-chip-content {
7484
display: block;
7585
padding-right:rem(0.4);
@@ -83,8 +93,9 @@ $contact-chip-name-width: rem(12) !default;
8393
}
8494
}
8595
.md-chip-remove-container {
86-
display: inline-block;
87-
margin-right: rem(-0.5);
96+
position: absolute;
97+
right: 0;
98+
line-height: $chip-remove-line-height;
8899
}
89100
.md-chip-remove {
90101
text-align: center;

src/components/chips/demoBasicUsage/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
}
3737
&:not(.md-readonly) {
3838
md-chip-template {
39-
padding-right: 20px;
39+
padding-right: 5px;
4040
}
4141
}
4242
}

0 commit comments

Comments
 (0)