# All files / components/Anchor/styles ExternalIconAnchor.js

75% Statements 6/8
0% Branches 0/6
0% Functions 0/2
75% Lines 6/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

    4x

    4x

    4x

    4x

    4x

    4x

     import ExternalTextAnchor from './ExternalTextAnchor';
    import { css } from 'styled-components';
    import get from 'extensions/themeGet';
    import icons from 'components/Icon/icons';
    import Icon from 'components/Icon';

    const iconStyles = css`
      text-decoration: none;
      display: inline-block;
      text-transform: uppercase;
      font-weight: 700;

      &::after {
        opacity: 0;
      }

      &::before {
        font-family: ${get('fonts.icon')};
        content: ${({ icon }) => (!!icon ? `"${icons(icon)}"` : '')};
        font-weight: normal;
        margin-right: ${({ icon, children }) =>
          !!icon && !!children ? '0.5em' : '0'};
      }

      & > ${Icon} {
        font-weight: normal;
      }
    `;

    const ExternalIconAnchor = ExternalTextAnchor.extend`
      ${iconStyles};
    `;

    ExternalIconAnchor.Danger = ExternalIconAnchor.Negative = ExternalTextAnchor
      .Danger.extend`
      ${iconStyles}
    `;

    ExternalIconAnchor.Positive = ExternalTextAnchor.Positive.extend`
      ${iconStyles}
    `;

    ExternalIconAnchor.Dark = ExternalTextAnchor.Dark.extend`
      ${iconStyles}
    `;

    ExternalIconAnchor.Inverted = ExternalTextAnchor.Inverted.extend`
      ${iconStyles}
    `;

    export default ExternalIconAnchor;