Choices Stepper

Installation

  yarn add @chewy/kib-choices-styles

Import

  @use '~@chewy/kib-choices-styles/src/kib-stepper/styles' as kib-stepper;

Mixins

root-container

@mixin root-container() { ... }@mixin root-container() { 
  display: flex;
  justify-content: flex-start;
 }
Description

Stepper root element styles

Parameters

None.

Author
  • CDS

content

@mixin content() { ... }@mixin content() { 
  position: relative;
 }
Description

Stepper content container

Parameters

None.

Author
  • CDS

controls-wrapper

@mixin controls-wrapper() { ... }@mixin controls-wrapper() { 
  padding: settings.$controls-offset;
  width: 100%;
  display: flex;
  justify-content: flex-end;
 }
Description

Stepper controls wrapper

Parameters

None.

Requires
Author
  • CDS

controls-wrapper-with-content

@mixin controls-wrapper-with-content() { ... }@mixin controls-wrapper-with-content() { 
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
 }
Description

Stepper content

Parameters

None.

Author
  • CDS

controls

@mixin controls() { ... }@mixin controls() { 
  @include typography.style-as('button');

  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  min-width: settings.$action-size;
  height: settings.$action-size;
  max-width: settings.$max-width;
  background-color: settings.$background-color;
  border-radius: settings.$border-radius;
  box-shadow: settings.$elevation;
  transition: all 200ms; // needs to be `all` and in ms for transition to work on Safari
  will-change: flex;
 }
Description

Stepper controls

Parameters

None.

Requires
Author
  • CDS

controls-open

@mixin controls-open() { ... }@mixin controls-open() { 
  flex-grow: 1;
  align-items: center;
  justify-content: space-between;
 }
Description

Stepper wrapper styles when it is opened

Parameters

None.

Author
  • CDS

count-wrapper

@mixin count-wrapper() { ... }@mixin count-wrapper() { 
  order: 2;
  flex-grow: 1;
 }
Description

Stepper count wrapper

Parameters

None.

Author
  • CDS

count

@mixin count() { ... }@mixin count() { 
  padding: spacing.get('s2');
  width: 100%;
  min-width: kib-core.dimensions-get(huge);
  text-align: center;
 }
Description

Stepper count

Parameters

None.

Requires
Author
  • CDS

action

@mixin action() { ... }@mixin action() { 
  margin: 0;
  padding: spacing.get('s2');
  position: relative;
  flex-shrink: 0;
  min-width: settings.$action-size;
  height: settings.$action-size;
  appearance: none;
  background-color: settings.$action-background-color;
  border: settings.$action-border-width solid transparent;
  border-radius: settings.$border-radius;
  box-shadow: none;
  color: settings.$action-color;
  cursor: pointer;
  font: inherit;
  transition: background-color 0.2s, border-color 0.2s;

  @media screen and (prefers-reduced-motion: reduce) {
    transition: none;
  }

  &:hover {
    background-color: settings.$action-background-color-hover;
  }

  &:active {
    background-color: settings.$action-background-color-active;
  }

  &:focus {
    outline: 0;

    &:not(:hover) {
      border-color: currentColor;
    }
  }

  &--disabled {
    color: settings.$action-color-disabled;
    pointer-events: none;
  }
 }
Description

Stepper action button

Parameters

None.

Author
  • CDS

action-icon

@mixin action-icon() { ... }@mixin action-icon() { 
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
  width: kib-core.dimensions-get(large);
  height: kib-core.dimensions-get(large);
  fill: currentColor;
 }
Description

Stepper action button icon

Parameters

None.

Author
  • CDS

action-add

@mixin action-add() { ... }@mixin action-add() { 
  order: 3;
  z-index: 1;
 }
Description

Stepper add action button

Parameters

None.

Author
  • CDS

action-remove

@mixin action-remove() { ... }@mixin action-remove() { 
  order: 1;
 }
Description

Stepper remove action button

Parameters

None.

Author
  • CDS

Variables

background-color

$background-color: color.get('action', 'cta', 'alternate', 'primary') !default;
Description

Stepper background color

Type

Color

Author
  • CDS

border-radius

$border-radius: kib-core.dimensions-get('huge') !default;
Description

Stepper border radius

Type

Number

Author
  • CDS

elevation

$elevation: rgba(#000, 0.16) 0 unit.rem(2px) kib-core.dimensions-get('tiny') !default;
Description

Stepper box shadow

Type

Box shadow

Used by
Author
  • CDS

max-width

$max-width: unit.rem(240px) !default;
Description

Maximum width for stepper controls to expand to on open

Type

Number

Used by
Author
  • CDS

controls-offset

$controls-offset: spacing.get('s1') !default;
Description

Offset spacing between controls element and content bounds

Used by
Author
  • CDS

action-color

$action-color: color.get('action', 'cta', 'alternate', 'text') !default;
Description

Stepper action color

Type

Color

Used by
Author
  • CDS

action-background-color

$action-background-color: $background-color !default;
Description

Stepper action background color

Type

Color

Used by
Author
  • CDS

action-background-color-hover

$action-background-color-hover: color.get('action', 'utility', 'alternate', '03') !default;
Description

Stepper action hover background color

Type

Color

Used by
Author
  • CDS

action-background-color-active

$action-background-color-active: color.get('action', 'utility', 'alternate', '02') !default;
Description

Stepper action active background color

Type

Color

Used by
Author
  • CDS

action-border-width

$action-border-width: unit.rem(1px) !default;
Description

Stepper action border width, visible on focus

Type

Color

Used by
Author
  • CDS

action-color-disabled

$action-color-disabled: color.get('action', 'utility', 'alternate', '02') !default;
Description

Disabled action color

Type

Color

Used by
Author
  • CDS

action-size

$action-size: kib-core.dimensions-get('huge') !default;
Description

Stepper action size

Type

Number

Used by
Author
  • CDS