import styled, { css } from 'styled-components' import { Theme } from '@lidofinance/theme' import { HeadingColors, HeadingSizes } from './types' export const sizes = { sm: css` font-size: ${({ theme }) => theme.fontSizesMap.xl}px; line-height: 1.3em; `, md: css` font-size: ${({ theme }) => theme.fontSizesMap.xxl}px; line-height: 1.3em; `, lg: css` font-size: ${({ theme }) => theme.fontSizesMap.xxxl}px; line-height: 1.3em; `, } type InjectedProps = { $color: HeadingColors theme: Theme } const getHeadingColor = (props: InjectedProps) => { const colorsMap = { text: props.theme.colors.text, secondary: props.theme.colors.textSecondary, } return colorsMap[props.$color] } const commonCSS = css` margin: 0; padding: 0; font-weight: 800; color: ${getHeadingColor}; ` export const HeadingStyle = styled.div` ${commonCSS} ${(props) => sizes[props.$size]} ` export const H1Style = styled.h1` ${commonCSS} ${sizes.lg} ` export const H2Style = styled.h2` ${commonCSS} ${sizes.md} ` export const H3Style = styled.h3` ${commonCSS} ${sizes.sm} `