Spinner
Installation
yarn add @chewy/kib-interstitials-styles
Import
@use '~@chewy/kib-interstitials-styles/src/kib-spinner/styles' as kib-spinner;
Mixins
wrapper-animation
@mixin wrapper-animation($name) { ... }
@mixin wrapper-animation($name) { /* stylelint-disable-next-line CssSyntaxError */ @keyframes #{$name} { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } }
Description
Generates the animation for the wrapper element
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | name for the animation | String | — none |
path-animation
@mixin path-animation($name) { ... }
@mixin path-animation($name) { /* stylelint-disable-next-line CssSyntaxError */ @keyframes #{$name} { 0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; } 50% { stroke-dasharray: 100px, 200px; stroke-dashoffset: 15px * -1; } 100% { stroke-dasharray: 100px, 200px; stroke-dashoffset: 125px * -1; } } }
Description
Generates the animation for the SVG circle path
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$name | name for the animation | String | — none |
container
@mixin container($animation-name) { ... }
@mixin container($animation-name) { display: inline-block; vertical-align: middle; color: currentColor; width: settings.$size; height: settings.$size; animation: settings.$animation-duration linear 0s infinite normal none running #{$animation-name}; }
Description
Generates the styles for the component container
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$animation-name | name of the wrapper animation | String | — none |
Requires
- [variable]
size
- [variable]
animation-duration
path
@mixin path($animation-name) { ... }
@mixin path($animation-name) { stroke: currentColor; stroke-width: settings.$circle-stroke-width; stroke-dasharray: 80px, 200px; stroke-dashoffset: 0; animation: settings.$animation-duration ease-in-out 0s infinite normal none running #{$animation-name}; }
Description
Generates the styles for the SVG circle path
Parameters
parameter Name | parameter Description | parameter Type | parameter Default value |
---|---|---|---|
$animation-name | name of the path animation | String | — none |
Requires
- [variable]
circle-stroke-width
- [variable]
animation-duration
Variables
size
$size: unit.rem(24px) !default;
Description
Spinner size
Type
Number
circle-stroke-width
$circle-stroke-width: 3.6 !default;