# All files / components/Loader/styles LoaderRing.js

0% Statements 0/14
0% Branches 0/4
0% Functions 0/3
0% Lines 0/8

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52

     import styled, { keyframes } from 'styled-components';
    import get from 'extensions/themeGet';

    const grow = keyframes`
      0% {
        transform: scale(0);
      }

      50% {
        opacity: 1;
        transform: scale(1);
      }

      100% {
        opacity: 0;
      }
    `;

    const LoaderRing = styled.div.withConfig({ displayName: 'LoaderRing' })`
      height: ${({ size }) => size};
      width: ${({ size }) => size};

      border-width: 2px;
      border-style: solid;
      border-color: ${get('colors.primary.default')};
      border-radius: 50%;
      margin: 0 5px;
      transform: scale(0);
      animation: ${grow} 1000ms ease infinite 0ms;

      &:nth-child(2) {
        animation-delay: 300ms;
      }
      &:nth-child(3) {
        animation-delay: 600ms;
      }

      &:first-child {
        margin-left: 0;
      }
      &:last-child {
        margin-right: 0;
      }
    `;

    LoaderRing.defaultProps = {
      size: '20px',
      color: null,
    };

    export default LoaderRing;