Skip to content

Commit

Permalink
fix(module:typography): single line ellipsis style (#6776)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsuanxyz authored Jun 15, 2021
1 parent 30ca5c8 commit e192a70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/typography/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,11 @@
}

// ============ Ellipsis ============
&-single-line {
white-space: nowrap;
}
&-ellipsis-single-line {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;

// https://blog.csdn.net/iefreer/article/details/50421025
Expand Down
1 change: 1 addition & 0 deletions components/typography/typography.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const EXPAND_ELEMENT_CLASSNAME = 'ant-typography-expand';
'[class.ant-typography-success]': 'nzType === "success"',
'[class.ant-typography-disabled]': 'nzDisabled',
'[class.ant-typography-ellipsis]': 'nzEllipsis && !expanded',
'[class.ant-typography-single-line]': 'nzEllipsis && nzEllipsisRows === 1',
'[class.ant-typography-ellipsis-single-line]': 'canCssEllipsis && nzEllipsisRows === 1',
'[class.ant-typography-ellipsis-multiple-line]': 'canCssEllipsis && nzEllipsisRows > 1',
'[style.-webkit-line-clamp]': '(canCssEllipsis && nzEllipsisRows > 1) ? nzEllipsisRows : null'
Expand Down

0 comments on commit e192a70

Please sign in to comment.