All files / src/Provider GlobalStyles.tsx

0% Statements 0/3
100% Branches 0/0
0% Functions 0/1
0% Lines 0/3

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                                                                                   
import * as React from 'react';
import { Global, ThemeContext, css } from '../styled';
import { palette, theme } from '../utils';
 
export default function GlobalStyles() {
  const _theme = React.useContext(ThemeContext);
  const styleProps = { theme: _theme };
  return (
    <Global
      styles={css`
        html,
        body {
          background-color: ${palette('background')(styleProps)};
          box-sizing: border-box;
          font-family: ${theme('global', 'fontFamily')(styleProps)};
          font-size: ${theme('global', 'fontSize')(styleProps)}px;
          line-height: 1.5;
          margin: 0;
          padding: 0;
          -webkit-font-smoothing: antialiased;
          text-rendering: optimizeLegibility;
          color: ${palette('text')(styleProps)};
          fill: ${palette('text')(styleProps)};
        }
 
        *,
        *::before,
        *::after {
          box-sizing: inherit;
        }
 
        *:focus {
          outline: 3px solid ${palette('primary200')(styleProps)};
          outline-offset: 2px;
        }
 
        ${theme('global.css.root')(styleProps)};
      `}
    />
  );
}