Skip to content

Commit fc3abf0

Browse files
fix(Tile): update outline-offset (#8258)
* fix(Tile): update outline-offset * fix(Tile): update outline-offset * fix(tile): need to confirm visual on Multi * fix(tile): need to confirm visual on 2px border * fix(tile): fix offset styling bug * fix(tile): fix multiselect tile double border * fix(tile): fix multiselect tile double border * fix(tile): prevent text from bouncing * Update _tile.scss Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 6a297fd commit fc3abf0

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

packages/components/src/components/tile/_tile.scss

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696

9797
.#{$prefix}--tile--selectable {
9898
padding-right: $carbon--spacing-09;
99+
border: 1px solid transparent;
99100
}
100101

101102
.#{$prefix}--tile__checkmark,
@@ -201,8 +202,7 @@
201202
}
202203

203204
.#{$prefix}--tile--is-selected {
204-
outline: 1px solid $ui-05;
205-
outline-offset: -1px;
205+
border: 1px solid $ui-05;
206206
}
207207

208208
.#{$prefix}--tile--is-selected .#{$prefix}--tile__checkmark {
@@ -220,6 +220,22 @@
220220
}
221221
}
222222

223+
// Fix double border
224+
.#{$prefix}--tile-input--checked + .#{$prefix}--tile--is-selected {
225+
border-top: 1px solid $ui-01;
226+
}
227+
228+
.#{$prefix}--tile:not(.#{$prefix}--tile--is-selected)
229+
+ .#{$prefix}--tile-input--checked
230+
+ .#{$prefix}--tile--is-selected {
231+
border-top: 1px solid $ui-05;
232+
}
233+
234+
.#{$prefix}--tile-input--checked:first-of-type
235+
+ .#{$prefix}--tile--is-selected {
236+
border-top: 1px solid $ui-05;
237+
}
238+
223239
.#{$prefix}--tile-content {
224240
width: 100%;
225241
height: 100%;

packages/react/src/components/Tile/Tile.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,10 @@ export class SelectableTile extends Component {
341341
...other
342342
} = this.props;
343343

344+
const inputClasses = classNames(`${prefix}--tile-input`, {
345+
[`${prefix}--tile-input--checked`]: this.state.selected,
346+
});
347+
344348
const classes = classNames(
345349
`${prefix}--tile`,
346350
`${prefix}--tile--selectable`,
@@ -360,7 +364,7 @@ export class SelectableTile extends Component {
360364
}}
361365
tabIndex={-1}
362366
id={id}
363-
className={`${prefix}--tile-input`}
367+
className={inputClasses}
364368
value={value}
365369
onChange={!disabled ? this.handleOnChange : null}
366370
type="checkbox"

0 commit comments

Comments
 (0)