UNPKG

@ant-design/pro-layout

Version:
64 lines 2.38 kB
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2"; import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; import { useStyle as useAntdStyle } from '@ant-design/pro-provider'; var genGlobalHeaderStyle = function genGlobalHeaderStyle(token) { var _token$layout, _token$layout2, _token$layout3; return _defineProperty({}, token.componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({ position: 'relative', background: 'transparent', display: 'flex', alignItems: 'center', marginBlock: 0, marginInline: 16, height: ((_token$layout = token.layout) === null || _token$layout === void 0 || (_token$layout = _token$layout.header) === null || _token$layout === void 0 ? void 0 : _token$layout.heightLayoutHeader) || 56, boxSizing: 'border-box', '> a': { height: '100%' } }, "".concat(token.proComponentsCls, "-layout-apps-icon"), { marginInlineEnd: 16 }), '&-collapsed-button', { minHeight: '22px', color: (_token$layout2 = token.layout) === null || _token$layout2 === void 0 || (_token$layout2 = _token$layout2.header) === null || _token$layout2 === void 0 ? void 0 : _token$layout2.colorHeaderTitle, fontSize: '18px', marginInlineEnd: '16px' }), '&-logo', { position: 'relative', marginInlineEnd: '16px', a: { display: 'flex', alignItems: 'center', height: '100%', minHeight: '22px', fontSize: '20px' }, img: { height: '28px' }, h1: { height: '32px', marginBlock: 0, marginInline: 0, marginInlineStart: 8, fontWeight: '600', color: ((_token$layout3 = token.layout) === null || _token$layout3 === void 0 || (_token$layout3 = _token$layout3.header) === null || _token$layout3 === void 0 ? void 0 : _token$layout3.colorHeaderTitle) || token.colorTextHeading, fontSize: '18px', lineHeight: '32px' }, '&-mix': { display: 'flex', alignItems: 'center' } }), '&-logo-mobile', { minWidth: '24px', marginInlineEnd: 0 })); }; export function useStyle(prefixCls) { return useAntdStyle('ProLayoutGlobalHeader', function (token) { var GlobalHeaderToken = _objectSpread(_objectSpread({}, token), {}, { componentCls: ".".concat(prefixCls) }); return [genGlobalHeaderStyle(GlobalHeaderToken)]; }); }