All files / theme typography.js

100% Statements 11/11
100% Branches 0/0
100% Functions 5/5
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    125x   35x   124x   35x 19x 19x       35x            
import { getTypography } from './themeSelectors';
 
export const getBaseFontSize = theme => getTypography(theme).baseFontSize;
 
export const getBaseLineHeight = theme => getTypography(theme).baseLineHeight;
 
export const rem = pxValue => ({ theme }) => `${pxValue / getBaseFontSize(theme)}rem`;
 
export const calcLineHeight = (remValue, baseLineHeight) => {
  const value = Number(remValue.replace('rem', ''));
  return `${(Math.ceil(value / baseLineHeight) * baseLineHeight) / value}`;
};
 
 
const typography = {
  baseFontSize: 16,
  baseLineHeight: 1.5,
};
 
export default typography;