diff --git a/packages/design/src/typography/hooks/useClassName.ts b/packages/design/src/typography/hooks/useClassName.ts index e07a92dbc..3b8b984ce 100644 --- a/packages/design/src/typography/hooks/useClassName.ts +++ b/packages/design/src/typography/hooks/useClassName.ts @@ -4,7 +4,6 @@ import classNames from 'classnames'; const useClassName = (prefixCls: string, className: string, editable?: BlockProps['editable']) => { const typographyCls = classNames( - prefixCls, { [`${prefixCls}-editable-text`]: typeof editable === 'object' && editable?.triggerType?.includes('text'), diff --git a/packages/design/src/typography/style/index.ts b/packages/design/src/typography/style/index.ts index 9f6f539ea..a3c1c53c8 100644 --- a/packages/design/src/typography/style/index.ts +++ b/packages/design/src/typography/style/index.ts @@ -41,17 +41,28 @@ export const genTypographyStyle: GenerateStyle = ( marginTop: -marginOffset, marginBottom: `calc(1em - ${marginOffset}px)`, }, + 'span&:hover': { + display: 'inline-block', + height: token.controlHeight, + marginTop: -marginOffset, + marginBottom: -marginOffset, + }, 'h1&:hover, h2&:hover, h3&:hover, h4&:hover, h5&:hover': { marginTop: `${-marginOffset}px !important`, marginBottom: `${-marginOffset}px !important`, }, }, [`${componentCls}${componentCls}-edit-content`]: { - 'div&': { + [`${componentCls}-div&`]: { insetInlineStart: -token.paddingSM, marginTop: -marginOffset, marginBottom: `calc(1em - ${marginOffset}px)`, }, + [`${componentCls}-span&`]: { + insetInlineStart: -token.paddingSM, + marginTop: -marginOffset, + marginBottom: -marginOffset, + }, [`${componentCls}-h1&, ${componentCls}-h2&, ${componentCls}-h3&, ${componentCls}-h4&, ${componentCls}-h5&`]: { insetInlineStart: -token.paddingSM,