Skip to content

Commit

Permalink
[EuiForm] Increase clear button contrast + fix display on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Nov 27, 2024
1 parent 3086ef9 commit 0580f23
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
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
Expand Up @@ -13,15 +13,20 @@ import { UseEuiTheme } from '../../../services';
export const EuiFormControlLayoutClearButtonStyles = ({
euiTheme,
colorMode,
highContrastMode,
}: UseEuiTheme) => {
const backgroundColor =
colorMode === 'DARK'
highContrastMode === 'forced'
? euiTheme.colors.fullShade
: colorMode === 'DARK' || highContrastMode // mediumShade is not sufficient WCAG contrast
? euiTheme.colors.darkShade
: euiTheme.colors.mediumShade;

return {
euiFormControlLayoutClearButton: css`
pointer-events: all;
background-color: ${backgroundColor};
${highContrastMode === 'forced' ? 'forced-color-adjust: none;' : ''}
border-radius: 50%;
line-height: 0; /* ensures the icon stays vertically centered */
Expand Down

0 comments on commit 0580f23

Please sign in to comment.