Image Select
Installation
yarn add @chewy/kib-choices-styles
Import
@use '~@chewy/kib-choices-styles/src/kib-image-select/styles' as kib-image-select;
Mixins
root-container
@mixin root-container() { ... }
@mixin root-container() { position: relative; display: inline-block; }
Description
Root container of choice component
Parameters
None.
control-native
@mixin control-native() { ... }
@mixin control-native() { @include kib-choice.choice-control-native; width: 100%; height: 100%; pointer-events: none; }
Description
Native input control styles
Parameters
None.
control-custom
@mixin control-custom($block) { ... }
@mixin control-custom($block) { @include kib-checkbox.checkbox-control-custom($block); position: absolute; top: 10px; right: 10px; z-index: 1; background-color: settings.$control-background-color; &, &::after { border-radius: 50%; } }
Description
Custom input control styles
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$block | root class of parent block element | String | — none |
Requires
- [variable]
control-background-color
control-fill
@mixin control-fill() { ... }
@mixin control-fill() { @include kib-checkbox.checkbox-control-fill; border-radius: 50%; // This fixes Safari bug that doesn't respect hidden overflow // while there's a transition inside an element with border radius. // @see https://gist.github.com/ayamflow/b602ab436ac9f05660d9c15190f4fd7b mask-image: radial-gradient(white, black); }
Description
Control fill with inner pseudo element to style checked state
Parameters
None.
label
@mixin label() { ... }
@mixin label() { @include kib-foundations.card; padding: spacing.get('s4'); overflow: hidden; cursor: pointer; touch-action: manipulation; &::before { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none; display: block; background-color: settings.$container-overlay-background-color; border-radius: inherit; content: ''; } img { display: block; max-width: 100%; width: 100%; } }
Description
Label element styled as image container
Parameters
None.
Requires
- [function]
get
- [variable]
container-overlay-background-color
Variables
control-background-color
$control-background-color: color.get('ui-bg', 'primary') !default;
Description
Background color of control element over the selection
Type
Color
Used by
- [mixin]
control-custom
container-overlay-background-color
$container-overlay-background-color: rgba(#000, 0.02) !default;
Description
Selection image container overlay background color (must be rgba)
Type
Color
Used by
- [mixin]
label