{"version":3,"file":"index.cjs","sources":["../../../../../../packages/components/comment/style/index.ts"],"sourcesContent":["import type { FullToken, GenerateStyle } from '@antdv/theme';\nimport { genComponentStyleHook, mergeToken } from '@antdv/theme';\n\nexport interface ComponentToken {}\n\ntype CommentToken = FullToken<'Comment'> & {\n  commentBg: string\n  commentPaddingBase: string\n  commentNestIndent: string\n  commentFontSizeBase: number\n  commentFontSizeSm: number\n  commentAuthorNameColor: string\n  commentAuthorTimeColor: string\n  commentActionColor: string\n  commentActionHoverColor: string\n  commentActionsMarginBottom: string\n  commentActionsMarginTop: number\n  commentContentDetailPMarginBottom: string\n};\n\nconst genBaseStyle: GenerateStyle<CommentToken> = (token) => {\n  const {\n    componentCls,\n    commentBg,\n    commentPaddingBase,\n    commentNestIndent,\n    commentFontSizeBase,\n    commentFontSizeSm,\n    commentAuthorNameColor,\n    commentAuthorTimeColor,\n    commentActionColor,\n    commentActionHoverColor,\n    commentActionsMarginBottom,\n    commentActionsMarginTop,\n    commentContentDetailPMarginBottom,\n  } = token;\n\n  return {\n    [componentCls]: {\n      'position': 'relative',\n      'backgroundColor': commentBg,\n\n      [`${componentCls}-inner`]: {\n        display: 'flex',\n        padding: commentPaddingBase,\n      },\n\n      [`${componentCls}-avatar`]: {\n        position: 'relative',\n        flexShrink: 0,\n        marginRight: token.marginSM,\n        cursor: 'pointer',\n\n        img: {\n          width: '32px',\n          height: '32px',\n          borderRadius: '50%',\n        },\n      },\n\n      [`${componentCls}-content`]: {\n        'position': 'relative',\n        'flex': '1 1 auto',\n        'minWidth': '1px',\n        'fontSize': commentFontSizeBase,\n        'wordWrap': 'break-word',\n\n        '&-author': {\n          'display': 'flex',\n          'flexWrap': 'wrap',\n          'justifyContent': 'flex-start',\n          'marginBottom': token.marginXXS,\n          'fontSize': commentFontSizeBase,\n\n          '& > a,& > span': {\n            paddingRight: token.paddingXS,\n            fontSize: commentFontSizeSm,\n            lineHeight: '18px',\n          },\n\n          '&-name': {\n            'color': commentAuthorNameColor,\n            'fontSize': commentFontSizeBase,\n            'transition': `color ${token.motionDurationSlow}`,\n\n            '> *': {\n              'color': commentAuthorNameColor,\n\n              '&:hover': {\n                color: commentAuthorNameColor,\n              },\n            },\n          },\n\n          '&-time': {\n            color: commentAuthorTimeColor,\n            whiteSpace: 'nowrap',\n            cursor: 'auto',\n          },\n        },\n\n        '&-detail p': {\n          marginBottom: commentContentDetailPMarginBottom,\n          whiteSpace: 'pre-wrap',\n        },\n      },\n\n      [`${componentCls}-actions`]: {\n        'marginTop': commentActionsMarginTop,\n        'marginBottom': commentActionsMarginBottom,\n        'paddingLeft': 0,\n\n        '> li': {\n          'display': 'inline-block',\n          'color': commentActionColor,\n\n          '> span': {\n            'marginRight': '10px',\n            'color': commentActionColor,\n            'fontSize': commentFontSizeSm,\n            'cursor': 'pointer',\n            'transition': `color ${token.motionDurationSlow}`,\n            'userSelect': 'none',\n\n            '&:hover': {\n              color: commentActionHoverColor,\n            },\n          },\n        },\n      },\n\n      [`${componentCls}-nested`]: {\n        marginLeft: commentNestIndent,\n      },\n\n      '&-rtl': {\n        direction: 'rtl',\n      },\n    },\n  };\n};\n\nexport default genComponentStyleHook('Comment', (token) => {\n  const commentToken = mergeToken<CommentToken>(token, {\n    commentBg: 'inherit',\n    commentPaddingBase: `${token.paddingMD}px 0`,\n    commentNestIndent: '44px',\n    commentFontSizeBase: token.fontSize,\n    commentFontSizeSm: token.fontSizeSM,\n    commentAuthorNameColor: token.colorTextTertiary,\n    commentAuthorTimeColor: token.colorTextPlaceholder,\n    commentActionColor: token.colorTextTertiary,\n    commentActionHoverColor: token.colorTextSecondary,\n    commentActionsMarginBottom: 'inherit',\n    commentActionsMarginTop: token.marginSM,\n    commentContentDetailPMarginBottom: 'inherit',\n  });\n\n  return [genBaseStyle(commentToken)];\n});\n"],"names":["genComponentStyleHook","mergeToken"],"mappings":";;;;;;;;AAoBA,MAAM,YAAA,GAA4C,CAAC,KAAU,KAAA;AAC3D,EAAM,MAAA;AAAA,IACJ,YA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