Skip to content

Commit 543f22b

Browse files
committed
[EuiSuperDatePicker] Improve Windows high contrast state indication
- needs updating still isn't great, but I think this is the best I can do for now :/
1 parent 1011d27 commit 543f22b

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

packages/eui/src/components/date_picker/super_date_picker/super_date_picker.styles.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
euiFormControlDefaultShadow,
2626
euiFormControlInvalidStyles,
2727
euiFormControlDisabledStyles,
28+
euiFormControlShowBackgroundUnderline,
2829
} from '../../form/form.styles';
2930

3031
export const euiSuperDatePickerStyles = (euiThemeContext: UseEuiTheme) => {
@@ -161,7 +162,10 @@ export const euiSuperDatePickerStyles = (euiThemeContext: UseEuiTheme) => {
161162
.euiDatePopoverButton:focus,
162163
.euiPopover-isOpen .euiDatePopoverButton {
163164
--euiFormControlStateColor: ${euiTheme.colors.primary};
164-
background-size: 100% 100%;
165+
${euiFormControlShowBackgroundUnderline(
166+
euiThemeContext,
167+
euiTheme.colors.primary
168+
)}
165169
}
166170
`,
167171
disabled: css`
@@ -197,8 +201,21 @@ export const euiSuperDatePickerStyles = (euiThemeContext: UseEuiTheme) => {
197201
.euiDatePopoverButton:focus,
198202
.euiPopover-isOpen .euiDatePopoverButton {
199203
--euiFormControlStateColor: ${euiTheme.colors.success};
200-
background-size: 100% 100%;
204+
${euiFormControlShowBackgroundUnderline(
205+
euiThemeContext,
206+
euiTheme.colors.success
207+
)}
201208
}
209+
210+
${highContrastMode === 'forced'
211+
? // Force the fill color of all icons/svgs to give a bit more indication of state,
212+
// since Windows high contrast themes otherwise override background/text color
213+
`
214+
svg,
215+
& + * svg {
216+
fill: ${euiTheme.colors.success};
217+
}`
218+
: ''}
202219
`,
203220
},
204221
};

packages/eui/src/components/form/form.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ export const euiFormControlAutoFillStyles = (euiThemeContext: UseEuiTheme) => {
346346
`;
347347
};
348348

349-
const euiFormControlShowBackgroundUnderline = (
349+
export const euiFormControlShowBackgroundUnderline = (
350350
euiThemeContext: UseEuiTheme,
351351
color: string
352352
) => {

0 commit comments

Comments
 (0)