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; }
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; }
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
- [variable]
star-stroke
- [variable]
star-stroke-width
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
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$large | — none | Boolean | — none |
Requires
- [variable]
size
- [variable]
size-large
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
- [function]
get
- [variable]
count-text-color
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;
count-text-color
$count-text-color: color.get('text', 'secondary') !default;
star-stroke
$star-stroke: color.get('ui-elements', 'rating', '02') !default;
star-stroke-width
$star-stroke-width: unit.rem(0.5px) !default;