Product Rating

Installation

  yarn add @chewy/kib-product-styles

Import

  @use '~@chewy/kib-product-styles/src/kib-product-rating/styles' as kib-product-rating;

Mixins

root-container

@mixin root-container() { ... }@mixin root-container() { 
  margin-bottom: spacing.get('s4');
  display: flex;
  align-items: center;
  justify-content: flex-start;
 }
Description

Styles for the component root container

Parameters

None.

Requires

hidden-label

@mixin hidden-label() { ... }@mixin hidden-label() { 
  @include kib-core.visually-hidden;
 }
Description

Hidden text label container for accessibility

Parameters

None.

stars-wrapper

@mixin stars-wrapper() { ... }@mixin stars-wrapper() { 
  position: relative;
  color: settings.$brand;
 }
Description

Wrapper for both empty and full stars groups

Parameters

None.

Requires

stars-common

@mixin stars-common() { ... }@mixin stars-common() { 
  display: flex;
  overflow: hidden;
  align-items: center;
  justify-content: flex-start;
  stroke: settings.$star-stroke;
  stroke-width: settings.$star-stroke-width;
 }
Description

Common styles for empty and full stars groups

Parameters

None.

Requires

stars-full

@mixin stars-full() { ... }@mixin stars-full() { 
  position: absolute;
  top: 0;
  left: 0;
 }
Description

Styles for the full stars group only

Parameters

None.

star-svg-icon

@mixin star-svg-icon($large) { ... }@mixin star-svg-icon($large) { 
  $size: if($large, settings.$size-large, settings.$size);

  flex-shrink: 0;
  width: $size;
  height: $size;
 }
Description

Base svg star icon styles and various size modifiers

Parameters
Parameters
parameter Nameparameter Descriptionparameter Typeparameter Default value
$large noneBoolean none
Requires

count-wrapper

@mixin count-wrapper() { ... }@mixin count-wrapper() { 
  @include typography.style-as('caption');

  padding-left: spacing.get('s2');
  color: settings.$count-text-color;
 }
Description

Wrapper for count content

Parameters

None.

Requires

count-label

@mixin count-label() { ... }@mixin count-label() { 
  @include kib-core.visually-hidden;
 }
Description

Count label styles

Parameters

None.

Variables

brand

$brand: color.get('ui-elements', 'rating', 'primary') !default;
Description

Star rating icon color

Type

Color

size

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

Default star icon size

Type

Number

size-large

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

Large star icon size

Type

Number

Used by

count-text-color

$count-text-color: color.get('text', 'secondary') !default;
Description

Count text color

Type

Color

Used by

star-stroke

$star-stroke: color.get('ui-elements', 'rating', '02') !default;
Description

Star stroke color

Type

Color

Used by

star-stroke-width

$star-stroke-width: unit.rem(0.5px) !default;
Description

Star stroke width

Type

Number

Used by