# All files / src/Toast Toast.styled.ts

86.67% Statements 13/15
100% Branches 0/0
0% Functions 0/2
100% Lines 13/13

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
    781x

    1x

    1x
    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

     import { themeGet } from '@fluent-ui/styles'
    import { Style, Styles } from 'jss'
    import { Theme } from '../styles'
    import { ToastClassProps } from './Toast.type'

    const root = (theme: Theme): Style => ({
      position: 'fixed',
      zIndex: 1001,
      backgroundColor: themeGet(`colors.white.default`, 'white')(theme),
      boxShadow: themeGet(
        `shadows.3`,
        '0px 6.4px 14.4px 0px rgba(0, 0, 0, 0.132), 0px 1.2px 3.6px 0px rgba(0, 0, 0, 0.108)'
      )(theme),
      borderRadius: 2,
      padding: '6px 16px',
      display: 'flex',
      alignItems: 'center',
      justifyContent: 'space-between'
    })
    const baseSpace = 24
    const placementTopStart: Style = {
      top: baseSpace,
      left: baseSpace,
      right: 'auto'
    }
    const placementTop: Style = {
      top: baseSpace,
      left: '50%',
      right: 'auto',
      transform: 'translateX(-50%)'
    }
    const placementTopEnd: Style = {
      top: baseSpace,
      left: 'auto',
      right: baseSpace
    }
    const placementBottomStart: Style = {
      bottom: baseSpace,
      left: baseSpace,
      right: 'auto'
    }
    const placementBottom: Style = {
      bottom: baseSpace,
      left: '50%',
      right: 'auto',
      transform: 'translateX(-50%)'
    }
    const placementBottomEnd: Style = {
      bottom: baseSpace,
      left: 'auto',
      right: baseSpace
    }
    const placementCenter: Style = {
      top: '50%',
      left: '50%',
      transform: 'translate(-50%, -50%)'
    }

    const container: Style = {
      padding: '8px 0',
      lineHeight: 1.5,
      flex: 1
    }
    const actions: Style = {}

    export const styles = (theme: Theme): Styles<ToastClassProps> => ({
      root: root(theme),
      placementTopStart,
      placementTop,
      placementTopEnd,
      placementBottomStart,
      placementBottom,
      placementBottomEnd,
      placementCenter,
      container,
      actions
    })