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

100% Statements 7/7
100% Branches 4/4
100% Functions 0/0
100% Lines 7/7

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
    6223x
    23x
    23x

    23x
    23x

    23x

    23x

     import styled from 'styled-components'
    import { Box } from '../Box/Box'
    import {
      StyledForm,
      StyledFormFieldBanner,
      StyledFormikForm,
      StyledFormRow,
    } from '../Form/Form.styles'
    import { mediaIE11Hack } from '../_styles/media'
    import { spacing } from '../_styles/spacing'

    export const StyledContent = styled(Box)`
      // any element that isn't first start with this space above
      // less specific than :first-child and one less rule
      > * + *,
      // these tags as components apply a browser reset
      // XComp and Content both have 10 specifity, which will be at mercy
      // of the CSS load order. Make these slighty more specific 11.
      // Keeping general spacing rules here (and less specific) rather than sprinkled everywhere
      > * + h1,
      > * + h2,
      > * + h3,
      > * + h4,
      > * + p,
      > * + ul,
      > * + ol {
        margin-top: ${spacing.lg}px;
      }

      > ${StyledFormRow} + * {
        margin-top: 0;
      }

      > ${StyledFormRow},
        > ${StyledForm}
        > ${StyledFormRow},
        > ${StyledFormikForm}
        > ${StyledFormRow} {
        ${StyledFormFieldBanner} {
          min-height: 0;
          margin-bottom: ${spacing.md}px;
        }
        &:last-child ${StyledFormFieldBanner} {
          margin-bottom: 0;
        }
      }
    `

    export const StyledActions = styled(Box)`
      display: flex;
      justify-content: flex-end;
      gap: ${spacing.sm}px;

      // Support horizontal space
      // Does not support vertical space when content wraps
      @media ${mediaIE11Hack} {
        & > * + * {
          margin-left: ${spacing.sm}px;
        }
      }
    `