UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

20 lines 1.38 kB
var _templateObject, _templateObject2; function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } import { createStyles } from 'antd-style'; import { SMOOTH_CORNER_MASKS } from "../utils/smoothCorners"; export var useStyles = createStyles(function (_ref) { var css = _ref.css; var baseRoot = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: hidden;\n flex: none;\n\n /* Fallback for browsers without mask support */\n border-radius: 15%;\n\n /* Apply smooth corners mask with fallback */\n @supports (mask-image: url('data:image/svg+xml;base64,')) {\n border-radius: 0;\n }\n "]))); var createCornerVariant = function createCornerVariant(cornerType) { return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n mask-image: url('", "');\n mask-position: center;\n mask-repeat: no-repeat;\n mask-size: 100% 100%;\n "])), SMOOTH_CORNER_MASKS[cornerType]); }; return { circle: createCornerVariant('circle'), ios: createCornerVariant('ios'), root: baseRoot, sharp: createCornerVariant('sharp'), smooth: createCornerVariant('smooth'), square: createCornerVariant('square'), squircle: createCornerVariant('squircle') }; });