@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
1 lines • 3.44 kB
Source Map (JSON)
{"version":3,"file":"Badge.module.cjs","names":[],"sources":["../../../src/components/Badge/Badge.module.css"],"sourcesContent":[".root {\n --badge-height-xs: 16px;\n --badge-height-sm: 18px;\n --badge-height-md: 20px;\n --badge-height-lg: 26px;\n --badge-height-xl: 32px;\n\n --badge-fz-xs: 9px;\n --badge-fz-sm: 10px;\n --badge-fz-md: 11px;\n --badge-fz-lg: 13px;\n --badge-fz-xl: 16px;\n\n --badge-padding-x-xs: 6px;\n --badge-padding-x-sm: 8px;\n --badge-padding-x-md: 10px;\n --badge-padding-x-lg: 12px;\n --badge-padding-x-xl: 16px;\n\n --badge-height: var(--badge-height-md);\n --badge-fz: var(--badge-fz-md);\n --badge-padding-x: var(--badge-padding-x-md);\n --badge-radius: 1000px;\n --badge-lh: calc(var(--badge-height) - rem(2px));\n --badge-color: var(--mantine-color-white);\n --badge-bg: var(--mantine-primary-color-filled);\n --badge-border-width: 1px;\n --badge-bd: var(--badge-border-width) solid transparent;\n\n -webkit-tap-highlight-color: transparent;\n font-size: var(--badge-fz);\n border-radius: var(--badge-radius);\n height: var(--badge-height);\n line-height: var(--badge-lh);\n text-decoration: none;\n padding: 0 var(--badge-padding-x);\n display: inline-grid;\n align-items: center;\n justify-content: center;\n width: fit-content;\n text-transform: uppercase;\n font-weight: var(--mantine-font-weight-bold);\n letter-spacing: 0.25px;\n cursor: default;\n text-overflow: ellipsis;\n overflow: hidden;\n color: var(--badge-color);\n background: var(--badge-bg);\n border: var(--badge-bd);\n\n &:where([data-with-left-section], [data-variant='dot']) {\n grid-template-columns: auto 1fr;\n }\n\n &:where([data-with-right-section]) {\n grid-template-columns: 1fr auto;\n }\n\n &:where(\n [data-with-left-section][data-with-right-section],\n [data-variant='dot'][data-with-right-section]\n ) {\n grid-template-columns: auto 1fr auto;\n }\n\n &:where([data-block]) {\n display: flex;\n width: 100%;\n }\n\n &:where([data-circle]) {\n padding-inline: 2px;\n display: flex;\n width: var(--badge-height);\n }\n}\n\n.root--dot {\n --badge-dot-size: calc(var(--badge-height) / 3.4);\n\n @mixin where-light {\n background-color: var(--mantine-color-white);\n border-color: var(--mantine-color-gray-4);\n color: var(--mantine-color-black);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n border-color: var(--mantine-color-dark-5);\n color: var(--mantine-color-white);\n }\n\n &::before {\n content: '';\n display: block;\n width: var(--badge-dot-size);\n height: var(--badge-dot-size);\n border-radius: var(--badge-dot-size);\n background-color: var(--badge-dot-color);\n margin-inline-end: var(--badge-dot-size);\n }\n}\n\n.label {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-align: center;\n cursor: inherit;\n text-box-trim: trim-both;\n text-box-edge: cap alphabetic;\n}\n\n.section {\n --badge-section-margin: calc(var(--mantine-spacing-xs) / 2);\n\n display: inline-flex;\n justify-content: center;\n align-items: center;\n max-height: calc(var(--badge-height) - var(--badge-border-width) * 2);\n\n &:where([data-position='left']) {\n margin-inline-end: var(--badge-section-margin);\n }\n\n &:where([data-position='right']) {\n margin-inline-start: var(--badge-section-margin);\n }\n}\n"],"mappings":""}