Skip to content

Commit 8e72d3c

Browse files
authored
fix(Tag): update filter tags to match updated spec (#7664)
* fix(tag): increase close button size and make flush with tag edges * fix(tag): reduce close button outline width * fix(tag): reduce small tag padding * fix(tag): reduce small tag close button size * fix(tag): reduce close button spacing to text * fix(tag): reduce high contrast tag outline * fix(tag): add transition
1 parent 96aa677 commit 8e72d3c

File tree

1 file changed

+20
-8
lines changed
  • packages/components/src/components/tag

1 file changed

+20
-8
lines changed

packages/components/src/components/tag/_tag.scss

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@
147147

148148
// tags used for filtering
149149
.#{$prefix}--tag--filter {
150-
padding-right: rem(2px);
150+
padding-top: 0;
151+
padding-right: 0;
152+
padding-bottom: 0;
151153
cursor: pointer;
152154

153155
&:hover {
@@ -156,17 +158,21 @@
156158
}
157159

158160
.#{$prefix}--tag__close-icon {
161+
display: flex;
159162
flex-shrink: 0;
160-
width: rem(16px);
161-
height: rem(16px);
162-
margin: 0 0 0 rem(4px);
163+
align-items: center;
164+
justify-content: center;
165+
width: rem(24px);
166+
height: rem(24px);
167+
margin: 0 0 0 rem(2px);
163168
padding: 0;
164169
color: currentColor;
165170
background-color: transparent;
166171
border: 0;
167172
border-radius: 50%;
168173
cursor: pointer;
169-
174+
transition: background-color $duration--fast-01 motion(standard, productive),
175+
box-shadow $duration--fast-01 motion(standard, productive);
170176
svg {
171177
fill: currentColor;
172178
}
@@ -195,7 +201,7 @@
195201
.#{$prefix}--tag__close-icon:focus {
196202
border-radius: 50%;
197203
outline: none;
198-
box-shadow: inset 0 0 0 2px $focus;
204+
box-shadow: inset 0 0 0 1px $focus;
199205

200206
// Windows, Firefox HCM Fix
201207
@media screen and (-ms-high-contrast: active),
@@ -206,7 +212,7 @@
206212
}
207213

208214
.#{$prefix}--tag--high-contrast .#{$prefix}--tag__close-icon:focus {
209-
box-shadow: inset 0 0 0 2px $inverse-focus-ui;
215+
box-shadow: inset 0 0 0 1px $inverse-focus-ui;
210216
}
211217

212218
.#{$prefix}--tag--filter.#{$prefix}--tag--disabled
@@ -225,7 +231,13 @@
225231
}
226232

227233
.#{$prefix}--tag--sm.#{$prefix}--tag--filter {
228-
padding-right: rem(2px);
234+
padding-right: 0;
235+
}
236+
237+
.#{$prefix}--tag--sm .#{$prefix}--tag__close-icon {
238+
width: rem(18px);
239+
height: rem(18px);
240+
margin-left: rem(5px);
229241
}
230242

231243
// Skeleton state

0 commit comments

Comments
 (0)