@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
1 lines • 7.14 kB
Source Map (JSON)
{"version":3,"file":"Button.module.cjs","names":[],"sources":["../../../src/components/Button/Button.module.css"],"sourcesContent":[".root {\n --button-height-xs: 30px;\n --button-height-sm: 36px;\n --button-height-md: 42px;\n --button-height-lg: 50px;\n --button-height-xl: 60px;\n\n --button-height-compact-xs: 22px;\n --button-height-compact-sm: 26px;\n --button-height-compact-md: 30px;\n --button-height-compact-lg: 34px;\n --button-height-compact-xl: 40px;\n\n --button-padding-x-xs: 14px;\n --button-padding-x-sm: 18px;\n --button-padding-x-md: 22px;\n --button-padding-x-lg: 26px;\n --button-padding-x-xl: 32px;\n\n --button-padding-x-compact-xs: 7px;\n --button-padding-x-compact-sm: 8px;\n --button-padding-x-compact-md: 10px;\n --button-padding-x-compact-lg: 12px;\n --button-padding-x-compact-xl: 14px;\n\n --button-height: var(--button-height-sm);\n --button-padding-x: var(--button-padding-x-sm);\n --button-color: var(--mantine-color-white);\n\n user-select: none;\n font-weight: var(--mantine-font-weight-medium);\n position: relative;\n line-height: 1;\n text-align: center;\n overflow: hidden;\n\n width: auto;\n cursor: pointer;\n display: inline-block;\n border-radius: var(--button-radius, var(--mantine-radius-default));\n font-size: var(--button-fz, var(--mantine-font-size-sm));\n background: var(--button-bg, var(--mantine-primary-color-filled));\n border: var(--button-bd, rem(1px) solid transparent);\n color: var(--button-color, var(--mantine-color-white));\n height: var(--button-height, var(--button-height-sm));\n padding-inline: var(--button-padding-x, var(--button-padding-x-sm));\n vertical-align: middle;\n\n &:where([data-block]) {\n display: block;\n width: 100%;\n }\n\n &:where([data-with-left-section]) {\n padding-inline-start: calc(var(--button-padding-x) / 1.5);\n }\n\n &:where([data-with-right-section]) {\n padding-inline-end: calc(var(--button-padding-x) / 1.5);\n }\n\n &:where(:disabled:not([data-loading]), [data-disabled]:not([data-loading])) {\n cursor: not-allowed;\n border: 1px solid transparent;\n transform: none;\n color: var(--mantine-color-disabled-color);\n background: var(--mantine-color-disabled);\n }\n\n &::before {\n content: '';\n pointer-events: none;\n position: absolute;\n inset: -1px;\n border-radius: var(--button-radius, var(--mantine-radius-default));\n transform: translateY(-100%);\n opacity: 0;\n filter: blur(12px);\n transition:\n transform 150ms ease,\n opacity 100ms ease;\n\n @mixin where-light {\n background-color: rgba(255, 255, 255, 0.15);\n }\n\n @mixin where-dark {\n background-color: rgba(0, 0, 0, 0.15);\n }\n }\n\n &:where([data-loading]) {\n cursor: not-allowed;\n transform: none;\n\n &::before {\n transform: translateY(0);\n opacity: 1;\n }\n\n & .inner {\n opacity: 0;\n transform: translateY(100%);\n }\n }\n\n @mixin hover {\n &:where(:not([data-loading], :disabled, [data-disabled])) {\n background-color: var(--button-hover, var(--mantine-primary-color-filled-hover));\n color: var(--button-hover-color, var(--button-color));\n }\n }\n}\n\n.inner {\n display: flex;\n align-items: center;\n justify-content: var(--button-justify, center);\n height: 100%;\n overflow: visible;\n transition:\n transform 150ms ease,\n opacity 100ms ease;\n}\n\n.label {\n white-space: nowrap;\n height: 100%;\n overflow: hidden;\n display: flex;\n align-items: center;\n opacity: 1;\n text-box-trim: trim-both;\n text-box-edge: cap alphabetic;\n\n &:where([data-loading]) {\n opacity: 0.2;\n }\n}\n\n.section {\n display: flex;\n align-items: center;\n\n &:where([data-position='left']) {\n margin-inline-end: var(--mantine-spacing-xs);\n }\n\n &:where([data-position='right']) {\n margin-inline-start: var(--mantine-spacing-xs);\n }\n}\n\n.loader {\n position: absolute;\n left: 50%;\n top: 50%;\n}\n\n.group {\n --button-border-width: 1px;\n display: flex;\n\n & :where(.root) {\n &:focus {\n position: relative;\n z-index: 1;\n }\n }\n\n &[data-orientation='horizontal'] {\n flex-direction: row;\n\n & .root,\n & .groupSection {\n &:not(:only-child):first-child {\n border-end-end-radius: 0;\n border-start-end-radius: 0;\n border-inline-end-width: calc(var(--button-border-width) / 2);\n }\n\n &:not(:only-child):last-child {\n border-end-start-radius: 0;\n border-start-start-radius: 0;\n border-inline-start-width: calc(var(--button-border-width) / 2);\n }\n\n &:not(:only-child):not(:first-child):not(:last-child) {\n border-radius: 0;\n border-inline-width: calc(var(--button-border-width) / 2);\n }\n }\n }\n\n &[data-orientation='vertical'] {\n flex-direction: column;\n\n & .root,\n & .groupSection {\n &:not(:only-child):first-child {\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n border-bottom-width: calc(var(--button-border-width) / 2);\n }\n\n &:not(:only-child):last-child {\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n border-top-width: calc(var(--button-border-width) / 2);\n }\n\n &:not(:only-child):not(:first-child):not(:last-child) {\n border-radius: 0;\n border-bottom-width: calc(var(--button-border-width) / 2);\n border-top-width: calc(var(--button-border-width) / 2);\n }\n }\n }\n}\n\n.groupSection {\n --section-height-xs: 30px;\n --section-height-sm: 36px;\n --section-height-md: 42px;\n --section-height-lg: 50px;\n --section-height-xl: 60px;\n\n --section-height-compact-xs: 22px;\n --section-height-compact-sm: 26px;\n --section-height-compact-md: 30px;\n --section-height-compact-lg: 34px;\n --section-height-compact-xl: 40px;\n\n --section-padding-x-xs: 14px;\n --section-padding-x-sm: 18px;\n --section-padding-x-md: 22px;\n --section-padding-x-lg: 26px;\n --section-padding-x-xl: 32px;\n\n --section-padding-x-compact-xs: 7px;\n --section-padding-x-compact-sm: 8px;\n --section-padding-x-compact-md: 10px;\n --section-padding-x-compact-lg: 12px;\n --section-padding-x-compact-xl: 14px;\n\n --section-height: var(--section-height-sm);\n --section-padding-x: var(--section-padding-x-sm);\n --section-color: var(--mantine-color-white);\n\n font-weight: var(--mantine-font-weight-medium);\n width: auto;\n border-radius: var(--section-radius, var(--mantine-radius-default));\n font-size: var(--section-fz, var(--mantine-font-size-sm));\n background: var(--section-bg, var(--mantine-primary-color-filled));\n border: var(--section-bd, rem(1px) solid transparent);\n color: var(--section-color, var(--mantine-color-white));\n height: var(--section-height, var(--section-height-sm));\n padding-inline: var(--section-padding-x, var(--section-padding-x-sm));\n vertical-align: middle;\n line-height: 1;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n"],"mappings":""}