# All files / src/Navigation/components Item.styled.ts

100% Statements 11/11
56.25% Branches 9/16
100% Functions 6/6
100% Lines 11/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    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
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    11x

    11x

    12x

    12x

    12x

    11x

    11x

    11x
    12x
    12x

    12x

     import * as CSS from 'csstype'
    import { styled, css, variant, th } from '../../styles/styled'

    export const StyledItemWrapper = styled.div<{
      reveal: boolean
    }>`
      position: relative;
      cursor: pointer;
      text-decoration: none;
      min-height: 40px;
      height: 40px;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 12px;
      box-sizing: border-box;
      transition: ${th.transition('navigation')};
      color: inherit;
      background-color: ${({ reveal }): CSS.ColorProperty =>
        reveal ? th.color('standard.light2') : 'transparent'};
      &:hover {
        background-color: ${({ reveal }): CSS.ColorProperty =>
          reveal ? th.color('standard.light1') : th.color('standard.transparent1')};
      }
      &:active {
        color: ${th.color('black.default')};
        background-color: ${({ reveal }): CSS.ColorProperty =>
          reveal ? th.color('standard.dark1') : th.color('standard.transparent2')};
      }
    `
    export const StyledItemActiveBar = styled.div<{
      active: boolean
      horizontal: boolean
    }>`
      position: absolute;
      background-color: ${th.color('primary.default')};
      transition: ${th.transition('navigation')};
      ${variant({
        prop: 'horizontal',
        variants: {
          true: css`
            width: 80%;
            height: 4px;
            left: 10%;
            bottom: 0;
          `,
          false: css`
            width: 6px;
            height: 24px;
            left: 0;
            top: 50%;
            margin-top: -12px;
          `
        }
      })}
      ${variant({
        prop: 'active',
        variants: {
          true: css`
            transform: scale3d(1, 1, 1);
          `,
          false: css`
            transform: scale3d(0, 0, 0);
          `
        }
      })}
    `
    export const StyledItemIconWrapper = styled.div`
      height: 100%;
      transition: ${th.transition('navigation')};
    `
    export const StyledItemTextWrapper = styled.div<{ expanded: boolean; hasIcon: boolean }>`
      width: ${({ expanded }): string => (expanded ? 'auto' : '0px')};
      opacity: ${({ expanded }): number => (expanded ? 1 : 0)};
      padding-left: ${({ children, expanded, hasIcon }): string =>
        children ? (expanded ? (hasIcon ? '12px' : '0px') : '0px') : '0px'};
      flex: 1;
      align-items: center;
      overflow: hidden;
      white-space: nowrap;
      transition: ${th.transition('navigation')};
    `