All files / src/SideNav styles.ts

100% Statements 8/8
100% Branches 4/4
100% Functions 4/4
100% Lines 4/4

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 84 85 86 87 88 89 90      13x               65x                             65x                       117x                                                                                                      
import { css, cssClass } from '../styled';
import { fontSize, fontWeight, palette, space, theme } from '../utils';
 
export const SideNav = styleProps => cssClass`
  width: 100%;
 
  & {
    ${theme(styleProps.themeKey, `css.root`)(styleProps)};
  }
`;
 
export const SideNavLevel = styleProps => cssClass`
  &&& {
    margin-left: unset;
  }
 
  ${styleProps.level === 0 &&
    css`
      margin-bottom: ${space(2, 'major')(styleProps)}rem;
    `}
 
  & {
    ${theme(styleProps.themeKey, `css.root`)(styleProps)};
  }
`;
 
export const SideNavLevelTitle = styleProps => cssClass`
  font-size: ${fontSize('150')(styleProps)}rem;
  font-weight: ${fontWeight('semibold')(styleProps)};
  margin-bottom: ${space(2)(styleProps)}rem;
  padding-left: ${styleProps.level}rem;
  text-transform: uppercase;
 
  & {
    ${theme(styleProps.themeKey, `css.root`)(styleProps)};
  }
`;
 
export const SideNavItem = styleProps => cssClass`
  align-items: center;
  cursor: pointer;
  display: flex;
  min-height: 2.75em;
  padding: 0 1rem;
  padding-left: ${styleProps.level}rem;
  transition: box-shadow 0.1s ease-in-out 0s, background-color 0.1s, color 0.1s;
 
  a& {
    color: unset;
    fill: unset;
    text-decoration: unset;
 
    &:hover {
      color: unset;
      fill: unset;
    }
  }
 
  &&&:hover {
    color: ${palette('primary')(styleProps)};
 
    & {
      ${theme(styleProps.themeKey, `css.hover`)(styleProps)};
    }
  }
 
  &:focus {
    outline: unset;
    background-color: ${palette('primaryTint')(styleProps)};
 
    & {
      ${theme(styleProps.themeKey, `css.focus`)(styleProps)};
    }
  }
 
  ${styleProps.isActive &&
    css`
      background-color: ${palette('primaryTint')(styleProps)};
      box-shadow: inset 3px 0 0 0 ${palette('primary')(styleProps)};
 
      & {
        ${theme(styleProps.themeKey, `css.active`)(styleProps)};
      }
    `}
 
  & {
    ${theme(styleProps.themeKey, `css.root`)(styleProps)};
  }
`;