# All files / src/FilterToken FilterToken.styles.tsx

100% Statements 10/10
60% Branches 6/10
100% Functions 1/1
100% Lines 9/9

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
    521x
    1x

    1x
    1x
    1x

    1x

    1x

    2x
    2x

     import styled, { css } from 'styled-components'
    import {
      getTypographyIntent,
      semiboldRules,
    } from '../Typography/Typography.styles'
    import { colors } from '../_styles/colors'
    import { getEllipsis, getFocus } from '../_styles/mixins'
    import { spacing } from '../_styles/spacing'

    export const StyledLabel = styled.span`
      ${getTypographyIntent('body')}

      ${getEllipsis}

      ${semiboldRules}

      flex: 0 1 auto;
    `

    export const StyledFilterToken = styled.div<{
      $focused: boolean
    }>`
      align-items: center;
      background-color: ${colors.blue96};
      border-radius: 4px; // TODO investigate this magic number
      border: 1px solid transparent;
      color: ${colors.blue45};
      cursor: default;
      display: inline-flex;
      height: 36px;
      justify-content: space-between;
      line-height: 1; // TODO investigate this magic number
      max-width: 360px; // TODO investigate this magic number
      min-width: 48px; // TODO investigate this magic number
      padding: ${spacing.sm}px ${spacing.md}px;

      &:hover,
      &.hover {
        background-color: ${colors.blue90};
      }

      ${({ $focused = false }) =>
        $focused &&
        css`
          ${getFocus()}

          background-color: ${colors.blue96};
          border-color: ${colors.blue40}
          border-width: 2px;
        `}
    `