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

0% Statements 0/31
0% Branches 0/12
0% Functions 0/4
0% Lines 0/17

    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
    53
    54
    55
    56
    57

     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';
    import styled from 'styled-components';
    import { base, positive, negative, dark, inverted } from './sharedStyles';

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

      &::after {
        opacity: ${({ appearFocused }) => (appearFocused ? 0.125 : 0)};
      }

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

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

    const ExternalIconAnchor = styled.a`
      ${base} ${iconStyles};
    `;

    ExternalIconAnchor.Negative = styled.a`
      ${base} ${iconStyles};
      ${negative};
    `;
    ExternalIconAnchor.Danger = ExternalIconAnchor.Negative;

    ExternalIconAnchor.Positive = styled.a`
      ${base} ${iconStyles};
      ${positive};
    `;

    ExternalIconAnchor.Dark = styled.a`
      ${base} ${iconStyles};
      ${dark};
    `;

    ExternalIconAnchor.Inverted = styled.a`
      ${base} ${iconStyles};
      ${inverted};
    `;

    export default ExternalIconAnchor;