1 line
14 KiB
JSON
1 line
14 KiB
JSON
|
{"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { resetComponent, textEllipsis } from '../../style';\nimport { genStyleHooks, mergeToken } from '../../theme/internal';\n// ============================== Shared ==============================\nconst genSharedAnchorStyle = token => {\n const {\n componentCls,\n holderOffsetBlock,\n motionDurationSlow,\n lineWidthBold,\n colorPrimary,\n lineType,\n colorSplit,\n calc\n } = token;\n return {\n [`${componentCls}-wrapper`]: {\n marginBlockStart: calc(holderOffsetBlock).mul(-1).equal(),\n paddingBlockStart: holderOffsetBlock,\n // delete overflow: auto\n // overflow: 'auto',\n [componentCls]: Object.assign(Object.assign({}, resetComponent(token)), {\n position: 'relative',\n paddingInlineStart: lineWidthBold,\n [`${componentCls}-link`]: {\n paddingBlock: token.linkPaddingBlock,\n paddingInline: `${unit(token.linkPaddingInlineStart)} 0`,\n '&-title': Object.assign(Object.assign({}, textEllipsis), {\n position: 'relative',\n display: 'block',\n marginBlockEnd: token.anchorTitleBlock,\n color: token.colorText,\n transition: `all ${token.motionDurationSlow}`,\n '&:only-child': {\n marginBlockEnd: 0\n }\n }),\n [`&-active > ${componentCls}-link-title`]: {\n color: token.colorPrimary\n },\n // link link\n [`${componentCls}-link`]: {\n paddingBlock: token.anchorPaddingBlockSecondary\n }\n }\n }),\n [`&:not(${componentCls}-wrapper-horizontal)`]: {\n [componentCls]: {\n '&::before': {\n position: 'absolute',\n insetInlineStart: 0,\n top: 0,\n height: '100%',\n borderInlineStart: `${unit(lineWidthBold)} ${lineType} ${colorSplit}`,\n content: '\" \"'\n },\n [`${componentCls}-ink`]: {\n position: 'absolute',\n insetInlineStart: 0,\n display: 'none',\n transform: 'translateY(-50%)',\n transition: `top ${motionDurationSlow} ease-in-out`,\n width: lineWidthBold,\n backgroundColor: colorPrimary,\n [`&${componentCls}-ink-visible`]: {\n display: 'inline-block'\n }\n }\n }\n },\n [`${componentCls}-fixed ${componentCls}-ink ${componentCls}-ink`]: {\n display: 'none'\n }\n }\n };\n};\nconst genSharedAnchorHorizontalStyle = token => {\n const {\n componentCls,\n motionDurationSlow,\n lineWidthBold,\n colorPrimary\n } = token;\n return {\n [`${componentCls}-wrapper-horizontal`]: {\n position: 'relative',\n '&::before': {\n position: 'absolute',\n left: {\n _skip_check_: true,\n value: 0\n },\n right: {\n _skip_check_: true,\n value: 0\n },\n bottom: 0,\n borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,\n content: '\" \"'\n },\n [componentCls]: {\n overflowX: 'scroll',\n position: 'relative',\n display: 'flex',\n scrollbarWidth: 'none' /* Firefox */,\n '&::-webkit-scrollbar': {\n display: 'none' /* Safari and Chrome */\n },\n [`${componentCls}-link:first-of-type`]: {\n paddingInline: 0\n },\n [`${componentCls}-ink`]: {\n position: 'absolute',\n bottom: 0,\n transition: `left ${motionDurationSlow} ease-in-out, width ${motionDurationSlow} ease-in-out`,\n height: lineWidthBold,\n backgroundColor: colorPrimary\n }\n }\n }\n };\n};\nexport const prepareComponentToken = token => ({\n linkPaddingBlock: token.paddingXXS,\n linkPaddingInlineStart: token.padding\n});\n// ============================== Export ==============================\nexport default genS
|