UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

1 lines 889 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;AAAI;AAEpD,SAAgB,mBAAmB,OAAgB,OAAqB;CACtE,IAAI,OAAO,UAAU,YAAY,SAAS,MAAM,aAC9C,OAAO,6BAA6B,MAAM;CAG5C,IAAI,OAAO,UAAU,YAAY,SAAS,SAAS,KAAK,GACtD,OAAO,iBAAiB,MAAM;CAGhC,OAAO;AACT"}