Skip to content

Commit

Permalink
Update color of delimiter arrow during needs update state to match …
Browse files Browse the repository at this point in the history
…Figma
  • Loading branch information
cee-chen committed Apr 12, 2023
1 parent ea6619f commit a324802
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,21 @@
cursor: not-allowed;
}
}

/**
* Make the arrow delimiter match the colors of `.euiDatePopoverButton-needsUpdating`
*/
.euiSuperDatePicker--needsUpdating.euiFormControlLayoutDelimited { // Extra specificity needed to override default delimited styles
.euiFormControlLayoutDelimited__delimiter {
background-color: $euiSuperDatePickerNeedsUpdatingBackgroundColor;
color: $euiSuperDatePickerNeedsUpdatingTextColor;

.euiIcon {
color: currentcolor;
}
}
}

.euiSuperDatePicker .euiFormControlLayoutDelimited__delimiter {
transition: background $euiAnimSpeedFast ease-in; // Match @mixin euiSuperDatePickerText / .euiDatePopoverButton
}
3 changes: 3 additions & 0 deletions src/components/date_picker/super_date_picker/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
$euiSuperDatePickerWidth: $euiSize * 30;
$euiSuperDatePickerButtonWidth: $euiButtonMinWidth + ($euiSizeXS * 1.5);

$euiSuperDatePickerNeedsUpdatingBackgroundColor: tintOrShade($euiColorSuccess, 90%, 70%);
$euiSuperDatePickerNeedsUpdatingTextColor: makeHighContrastColor($euiColorSuccess, $euiSuperDatePickerNeedsUpdatingBackgroundColor);
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
}

&-needsUpdating {
$backgroundColor: tintOrShade($euiColorSuccess, 90%, 70%);
$textColor: makeHighContrastColor($euiColorSuccess, $backgroundColor);

background-color: $backgroundColor;
color: $textColor;
background-color: $euiSuperDatePickerNeedsUpdatingBackgroundColor;
color: $euiSuperDatePickerNeedsUpdatingTextColor;

&:focus,
&.euiDatePopoverButton-isSelected {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ export class EuiSuperDatePickerInternal extends Component<
{({ locale: contextLocale }) => (
<EuiDatePickerRange
{...formControlLayoutProps}
className={classNames(formControlLayoutProps.className, {
'euiSuperDatePicker--needsUpdating': hasChanged && !isDisabled,
})}
isCustom={true}
iconType={false}
startDateControl={
Expand Down

0 comments on commit a324802

Please sign in to comment.