Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/eui/changelogs/upcoming/9627.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Updated `EuiToolTip` default font size from 14px to 12px
65 changes: 8 additions & 57 deletions packages/eui/src/components/tool_tip/tool_tip.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* Side Public License, v 1.
*/

import { css, keyframes } from '@emotion/react';
import { css } from '@emotion/react';
import { euiShadow } from '@elastic/eui-theme-common';

import { logicalCSS, euiFontSize, euiCanAnimate } from '../../global_styling';
import { logicalCSS, euiFontSize } from '../../global_styling';
import { UseEuiTheme } from '../../services';
import { _popoverArrowStyles } from '../../services/popover';
import { euiPanelBorderStyles } from '../panel/panel.styles';
Expand All @@ -20,35 +20,10 @@ export const euiToolTipBackgroundColor = (euiTheme: UseEuiTheme['euiTheme']) =>
export const euiToolTipBorderColor = (euiTheme: UseEuiTheme['euiTheme']) =>
euiTheme.components.tooltipBorder;

const euiToolTipAnimationVertical = (size: string) => keyframes`
0% {
opacity: 0;
transform: translateY(${size});
}

100% {
opacity: 1;
transform: translateY(0);
}
`;

const euiToolTipAnimationHorizontal = (size: string) => keyframes`
0% {
opacity: 0;
transform: translateX(${size});
}

100% {
opacity: 1;
transform: translateX(0);
}
`;

export const euiToolTipStyles = (euiThemeContext: UseEuiTheme) => {
const { euiTheme, highContrastMode } = euiThemeContext;

const hasShadow = !highContrastMode;
const animationTiming = `${euiTheme.animation.slow} ease-out 0s forwards`;

const arrowSize = euiTheme.size.m;
const arrowStyles = _popoverArrowStyles(euiThemeContext, arrowSize);
Expand All @@ -64,7 +39,7 @@ export const euiToolTipStyles = (euiThemeContext: UseEuiTheme) => {
${logicalCSS('max-width', '256px')}
overflow-wrap: break-word;
padding: ${euiTheme.size.s};
${euiFontSize(euiThemeContext, 's')}
${euiFontSize(euiThemeContext, 'xs')}

position: absolute;

Expand All @@ -74,35 +49,11 @@ export const euiToolTipStyles = (euiThemeContext: UseEuiTheme) => {
background-color: ${euiToolTipBorderColor(euiTheme)};
}
`,
// Sizes
s: css`
${euiFontSize(euiThemeContext, 'xs')}
`,
// Positions
top: css`
${euiCanAnimate} {
animation: ${euiToolTipAnimationVertical(`-${euiTheme.size.base}`)}
${animationTiming};
}
`,
bottom: css`
${euiCanAnimate} {
animation: ${euiToolTipAnimationVertical(euiTheme.size.base)}
${animationTiming};
}
`,
left: css`
${euiCanAnimate} {
animation: ${euiToolTipAnimationHorizontal(`-${euiTheme.size.base}`)}
${animationTiming};
}
`,
right: css`
${euiCanAnimate} {
animation: ${euiToolTipAnimationHorizontal(euiTheme.size.base)}
${animationTiming};
}
`,
// Positions - kept for component compatibility. Animation is in the base style.
top: css``,
bottom: css``,
left: css``,
right: css``,
// Arrow
euiToolTip__arrow: css`
${arrowStyles._arrowStyles}
Expand Down