Product Price
Installation
yarn add @chewy/kib-product-stylesImport
@use '~@chewy/kib-product-styles/src/kib-product-price/styles' as kib-product-price;Mixins
root-container
@mixin root-container() { ... }@mixin root-container() { @include typography.style-as('price-medium'); grid-column: 1; grid-row: 1 / span 2; align-self: baseline; --kib-product-price-color: #{settings.$text-color}; color: var(--kib-product-price-color, #{settings.$text-color}); }
strikethrough
@mixin strikethrough() { ... }@mixin strikethrough() { grid-column: 2; grid-row: 2; @if $type == 'xs' { @include typography.style-as('price-x-small-strikethrough'); } @else if $type == 'xxs' { @include typography.style-as('price-xx-small-strikethrough'); } @else { @include typography.style-as('price-small-strikethrough'); } --kib-product-price-color: #{settings.$strike-text-color}; }
price-per-unit
@mixin price-per-unit() { ... }@mixin price-per-unit() { grid-column: 2; grid-row: 1; --kib-product-price-color: #{settings.$strike-text-color}; @include typography.style-as('caption'); }
deal
@mixin deal() { ... }@mixin deal() { --kib-product-price-color: #{settings.$deal-text-color}; }
font-styles
@mixin font-styles($type: md) { ... }@mixin font-styles($type: md) { @if $type == 'md' { @include typography.style-as('utility-5', 'strong'); } @else if $type == 'xs' { @include typography.style-as('utility-3', 'strong'); } @else if $type == 'sm' { @include typography.style-as('utility-4', 'strong'); } @else if $type == 'lg' { @include typography.style-as('utility-6', 'strong'); } @else if $type == 'xl' { @include typography.style-as('utility-7', 'strong'); } }
Description
Price specific font styles based on type
Parameters
| parameter Name | parameter Description | parameter Type | parameter Default value |
|---|---|---|---|
$type | Alias of font style preset | String | md |
label
@mixin label() { ... }@mixin label() { @include kib-core.visually-hidden; }
Description
Visually hidden text label
Parameters
None.
Variables
text-color
$text-color: color.get('ui-elements', 'price', '03') !default;Description
Text color for base price
Type
Color
strike-text-color
$strike-text-color: color.get('ui-elements', 'price', '02') !default;deal-text-color
$deal-text-color: color.get(
'ui-elements',
'price',
'primary'
) !default;Description
Text color for price that is a deal
Type
Color