Skip to content

Commit

Permalink
fix(comp:tooltip): tooltip content should wrap on line break (#1876)
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed Apr 8, 2024
1 parent 818722e commit ab4a449
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/components/tooltip/docs/Theme.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
| `fontSize` | | `number` | `12` | `12` |
| `maxWidth` | | `number` | `400` | `400` |
| `minWidth` | | `number` | `32` | `32` |
| `whiteSpace` | | `string` | `pre-wrap` | `pre-wrap` |
1 change: 1 addition & 0 deletions packages/components/tooltip/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
&-wrapper {
position: relative;
word-wrap: break-word;
white-space: var(--ix-tooltip-white-space);
min-width: var(--ix-tooltip-min-width);
max-width: var(--ix-tooltip-max-width);
padding: var(--ix-padding-size-xs) var(--ix-padding-size-sm);
Expand Down
1 change: 1 addition & 0 deletions packages/components/tooltip/theme/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
--ix-tooltip-color: #808999;
--ix-tooltip-min-width: 32px;
--ix-tooltip-max-width: 400px;
--ix-tooltip-white-space: pre-wrap;
}
1 change: 1 addition & 0 deletions packages/components/tooltip/theme/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
--ix-tooltip-color: #6f7785;
--ix-tooltip-min-width: 32px;
--ix-tooltip-max-width: 400px;
--ix-tooltip-white-space: pre-wrap;
}
2 changes: 2 additions & 0 deletions packages/components/tooltip/theme/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ export function getDefaultThemeTokens(tokens: GlobalThemeTokens): CertainThemeTo

minWidth: 32,
maxWidth: 400,

whiteSpace: 'pre-wrap',
}
}
2 changes: 2 additions & 0 deletions packages/components/tooltip/theme/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ export interface TooltipThemeTokens {

minWidth: number
maxWidth: number

whiteSpace: string
}

0 comments on commit ab4a449

Please sign in to comment.