Chips Choice

Installation

  yarn add @chewy/kib-chips-styles

Import

  @use '~@chewy/kib-chips-styles/src/kib-chip-choice/styles' as kib-chip-choice;

Mixins

chip-choice-base-container-styles

@mixin chip-choice-base-container-styles() { ... }@mixin chip-choice-base-container-styles() { 
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
 }
Description

Chip choice container base styles

Parameters

None.

Author
  • CDS

chip-choice-base-styles

@mixin chip-choice-base-styles($type) { ... }@mixin chip-choice-base-styles($type) { 
  @include common.chip-base-styles($type);

  border: unit.rem(1px) solid map.get(variants.$styles, $type, '$chip-border-color');
 }
Description

Chip choice base styles

Parameters
Parameters
parameter Nameparameter Descriptionparameter Typeparameter Default value
$type

Variant type for common chip styles

String none
Requires
Author
  • CDS

chip-choice-control-styles

@mixin chip-choice-control-styles() { ... }@mixin chip-choice-control-styles() { 
  opacity: 0;
  position: absolute;
  z-index: 2;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
 }
Description

Styles for chip choice input control removes native radio styling

Parameters

None.

Author
  • CDS

chip-choice-selected-styles

@mixin chip-choice-selected-styles($type) { ... }@mixin chip-choice-selected-styles($type) { 
  background: map.get(variants.$styles, $type, '$chip-selected-background');
  border: unit.rem(2px) solid map.get(variants.$styles, $type, '$chip-selected-border-color');

  &::after {
    $distance: unit.rem(-3px);

    top: $distance;
    left: $distance;
    right: $distance;
    bottom: $distance;
  }
 }
Description

Styles for selected chip choice

Parameters
Parameters
parameter Nameparameter Descriptionparameter Typeparameter Default value
$type

Variant type for common chip styles

String none
Requires
Author
  • CDS

chip-choice-active-styles

@mixin chip-choice-active-styles($type) { ... }@mixin chip-choice-active-styles($type) { 
  background: map.get(variants.$styles, $type, '$pressed-background');
 }
Description

Styles for chip choice when active

Parameters
Parameters
parameter Nameparameter Descriptionparameter Typeparameter Default value
$type

Variant type for common chip styles

String none
Requires
Author
  • CDS

chip-choice-hover-styles

@mixin chip-choice-hover-styles($type) { ... }@mixin chip-choice-hover-styles($type) { 
  box-shadow: 0 unit.rem(1px 1px) rgba(0, 0, 0, 0.14), 0 unit.rem(2px 1px -1px) rgba(0, 0, 0, 0.12),
    0 unit.rem(1px 3px) rgba(0, 0, 0, 0.2);
  background: map.get(variants.$styles, $type, '$hover-background');
 }
Description

Styles for chip choice when hovering

Parameters
Parameters
parameter Nameparameter Descriptionparameter Typeparameter Default value
$type

Variant type for common chip styles

String none
Requires
Author
  • CDS

chip-choice-disabled-styles

@mixin chip-choice-disabled-styles() { ... }@mixin chip-choice-disabled-styles() { 
  @include common.chip-disabled-styles;

  box-shadow: none;
  cursor: default;
  opacity: settings.$chip-choice-deselected-disabled-opacity;
 }
Description

Styles for disabled chip choice

Parameters

None.

Author
  • CDS

chip-choice-selected-disabled-styles

@mixin chip-choice-selected-disabled-styles() { ... }@mixin chip-choice-selected-disabled-styles() { 
  opacity: settings.$chip-choice-selected-disabled-opacity;
 }
Description

Styles for selected disabled chip choice

Parameters

None.

Author
  • CDS

Variables

chip-choice-icon-spacing

$chip-choice-icon-spacing: spacing.get('s1') !default;
Description

Chip choice spacing between icon and label

Type

Number

Author
  • CDS

chip-choice-selected-disabled-opacity

$chip-choice-selected-disabled-opacity: 0.3;
Description

Chip choice selected disabled opacity

Type

Number

Author
  • CDS

chip-choice-deselected-disabled-opacity

$chip-choice-deselected-disabled-opacity: 0.5;
Description

Chip choice deselected disabled opacity

Type

Number

Author
  • CDS