UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

1 lines 884 B
{"version":3,"file":"line-height-resolver.cjs","names":[],"sources":["../../../../../../src/core/Box/style-props/resolvers/line-height-resolver/line-height-resolver.ts"],"sourcesContent":["import { MantineTheme } from '../../../../MantineProvider';\n\nconst headings = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\nexport function lineHeightResolver(value: unknown, theme: MantineTheme) {\n if (typeof value === 'string' && value in theme.lineHeights) {\n return `var(--mantine-line-height-${value})`;\n }\n\n if (typeof value === 'string' && headings.includes(value)) {\n return `var(--mantine-${value}-line-height)`;\n }\n\n return value;\n}\n"],"mappings":";;AAEA,MAAM,WAAW;CAAC;CAAM;CAAM;CAAM;CAAM;CAAM;CAAK;AAErD,SAAgB,mBAAmB,OAAgB,OAAqB;AACtE,KAAI,OAAO,UAAU,YAAY,SAAS,MAAM,YAC9C,QAAO,6BAA6B,MAAM;AAG5C,KAAI,OAAO,UAAU,YAAY,SAAS,SAAS,MAAM,CACvD,QAAO,iBAAiB,MAAM;AAGhC,QAAO"}