Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/datetime picker warning hover style #356

Merged
merged 7 commits into from
Jun 14, 2022
9 changes: 9 additions & 0 deletions packages/elements/src/datetime-picker/__demo__/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
<ef-checkbox id="weekendsOnly">Weekends Only</ef-checkbox>
<ef-checkbox id="readonly">Readonly</ef-checkbox>
<ef-checkbox id="disabled">Disabled</ef-checkbox>
<ef-checkbox id="warning">Warning</ef-checkbox>
<ef-checkbox id="error">Error</ef-checkbox>
</p>
<p>
<ef-checkbox id="inputTriggerDisabled">Input Trigger Disabled</ef-checkbox>
Expand Down Expand Up @@ -121,6 +123,7 @@
duplex: dateTimePicker.duplex,
timepicker: dateTimePicker.timepicker,
amPm: dateTimePicker.amPm,
warning: dateTimePicker.warning,
error: dateTimePicker.error,
showSeconds: dateTimePicker.showSeconds,
lang: dateTimePicker.lang,
Expand Down Expand Up @@ -292,6 +295,12 @@
document.getElementById('disabled').addEventListener('checked-changed', ({ detail: { value } }) => {
dateTimePicker.disabled = value || undefined;
});
document.getElementById('warning').addEventListener('checked-changed', ({ detail: { value } }) => {
dateTimePicker.warning = value || undefined;
});
document.getElementById('error').addEventListener('checked-changed', ({ detail: { value } }) => {
dateTimePicker.error = value || undefined;
});
document.getElementById('readonly').addEventListener('checked-changed', ({ detail: { value } }) => {
dateTimePicker.readonly = value || undefined;
});
Expand Down
28 changes: 27 additions & 1 deletion packages/halo-theme/src/custom-elements/ef-datetime-picker.less
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,32 @@
}
}

&[warning]:not([focused]) {
border-color: @control-warning-color;
}

&[error]:not([focused]) {
border-color: @control-error-color;
}

&[warning]:hover:not([readonly]):not([focused]) {
border-color: @control-hover-warning-color;
}

&[warning][disabled],
&[warning][readonly]:not([focused]) {
border-color: fade(@control-hover-warning-color, 50%);
}

&[error]:hover:not([readonly]):not([focused]) {
border-color: @control-hover-error-color;
}

&[error][disabled],
&[error][readonly]:not([focused]) {
border-color: fade(@control-hover-error-color, 50%);
}

&[disabled] {
[part=icon] {
color: @input-disabled-text-color
Expand All @@ -36,7 +62,7 @@

&[focused],
&[focused][error][warning],
&:not([disabled]):hover {
&:not([disabled]):not([error]):not([warning]):hover {
[part=icon] {
color: @scheme-color-secondary;

Expand Down