1 line
18 KiB
JSON
1 line
18 KiB
JSON
|
{"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { genStyleHooks } from '../../theme/internal';\nimport genLayoutLightStyle from './light';\nconst genLayoutStyle = token => {\n const {\n antCls,\n // .ant\n componentCls,\n // .ant-layout\n colorText,\n triggerColor,\n footerBg,\n triggerBg,\n headerHeight,\n headerPadding,\n headerColor,\n footerPadding,\n triggerHeight,\n zeroTriggerHeight,\n zeroTriggerWidth,\n motionDurationMid,\n motionDurationSlow,\n fontSize,\n borderRadius,\n bodyBg,\n headerBg,\n siderBg\n } = token;\n return {\n [componentCls]: Object.assign(Object.assign({\n display: 'flex',\n flex: 'auto',\n flexDirection: 'column',\n /* fix firefox can't set height smaller than content on flex item */\n minHeight: 0,\n background: bodyBg,\n '&, *': {\n boxSizing: 'border-box'\n },\n [`&${componentCls}-has-sider`]: {\n flexDirection: 'row',\n [`> ${componentCls}, > ${componentCls}-content`]: {\n // https://segmentfault.com/a/1190000019498300\n width: 0\n }\n },\n [`${componentCls}-header, &${componentCls}-footer`]: {\n flex: '0 0 auto'\n },\n [`${componentCls}-sider`]: {\n position: 'relative',\n // fix firefox can't set width smaller than content on flex item\n minWidth: 0,\n background: siderBg,\n transition: `all ${motionDurationMid}, background 0s`,\n '&-children': {\n height: '100%',\n // Hack for fixing margin collapse bug\n // https://github.com/ant-design/ant-design/issues/7967\n // solution from https://stackoverflow.com/a/33132624/3040605\n marginTop: -0.1,\n paddingTop: 0.1,\n [`${antCls}-menu${antCls}-menu-inline-collapsed`]: {\n width: 'auto'\n }\n },\n '&-has-trigger': {\n paddingBottom: triggerHeight\n },\n '&-right': {\n order: 1\n },\n '&-trigger': {\n position: 'fixed',\n bottom: 0,\n zIndex: 1,\n height: triggerHeight,\n color: triggerColor,\n lineHeight: unit(triggerHeight),\n textAlign: 'center',\n background: triggerBg,\n cursor: 'pointer',\n transition: `all ${motionDurationMid}`\n },\n '&-zero-width': {\n '> *': {\n overflow: 'hidden'\n },\n '&-trigger': {\n position: 'absolute',\n top: headerHeight,\n insetInlineEnd: token.calc(zeroTriggerWidth).mul(-1).equal(),\n zIndex: 1,\n width: zeroTriggerWidth,\n height: zeroTriggerHeight,\n color: triggerColor,\n fontSize: token.fontSizeXL,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n background: siderBg,\n borderStartStartRadius: 0,\n borderStartEndRadius: borderRadius,\n borderEndEndRadius: borderRadius,\n borderEndStartRadius: 0,\n cursor: 'pointer',\n transition: `background ${motionDurationSlow} ease`,\n '&::after': {\n position: 'absolute',\n inset: 0,\n background: 'transparent',\n transition: `all ${motionDurationSlow}`,\n content: '\"\"'\n },\n '&:hover::after': {\n background: `rgba(255, 255, 255, 0.2)`\n },\n '&-right': {\n insetInlineStart: token.calc(zeroTriggerWidth).mul(-1).equal(),\n borderStartStartRadius: borderRadius,\n borderStartEndRadius: 0,\n borderEndEndRadius: 0,\n borderEndStartRadius: borderRadius\n }\n }\n }\n }\n }, genLayoutLightStyle(token)), {\n // RTL\n '&-rtl': {\n direction: 'rtl'\n }\n }),\n // ======
|