Skip to content

Commit

Permalink
style(tooltip): increase width to 500px and 2 lines items (#2261) (#2275
Browse files Browse the repository at this point in the history
)

Backport of #2261
  • Loading branch information
markov00 authored Dec 7, 2023
1 parent 5034852 commit 465a6bc
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
@mixin lineClamp($maxLines) {
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: $maxLines; /* number of lines to show */
line-clamp: $maxLines;
-webkit-box-orient: vertical;
overflow: hidden;
}

.echMetricText {
position: relative;
padding: 8px;
Expand Down
9 changes: 9 additions & 0 deletions packages/charts/src/components/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@
overflow: hidden;
min-width: 1px;
}

@mixin lineClamp($maxLines) {
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: $maxLines; /* number of lines to show */
line-clamp: $maxLines;
-webkit-box-orient: vertical;
overflow: hidden;
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ $transitionTime: 200ms;
}

.echTooltip__tableCell--truncate {
@include euiTextTruncate;
@include lineClamp(2);
}

&__metricRow {
Expand Down
8 changes: 4 additions & 4 deletions packages/charts/src/components/tooltip/placement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function getStylesFromPlacement(
case 'top-end':
case 'bottom-end':
return {
width: maxWidth,
maxWidth,
justifyContent: 'flex-end',
};
case 'right':
Expand All @@ -34,21 +34,21 @@ export function getStylesFromPlacement(
case 'top-start':
case 'bottom-start':
return {
width: maxWidth,
maxWidth,
justifyContent: 'flex-start',
};
case 'top':
case 'bottom':
return {
width: maxWidth,
maxWidth,
justifyContent: 'center',
};
case 'auto':
case 'auto-start':
case 'auto-end':
default:
return {
width: maxWidth,
maxWidth,
};
}
}
2 changes: 1 addition & 1 deletion packages/charts/src/utils/themes/dark_theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ export const DARK_THEME: Theme = {
minHeight: 64,
},
tooltip: {
maxWidth: 260,
maxWidth: 500,
maxTableHeight: 120,
defaultDotColor: Colors.White.keyword,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/utils/themes/light_theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ export const LIGHT_THEME: Theme = {
minHeight: 64,
},
tooltip: {
maxWidth: 260,
maxWidth: 500,
maxTableHeight: 120,
defaultDotColor: Colors.Black.keyword,
},
Expand Down

0 comments on commit 465a6bc

Please sign in to comment.