Restyle date inputs and checkboxes to match the blue UI

- date / datetime-local: themed calendar button, blue segment highlight,
  disabled state for all text controls
- checkbox: custom 18px box (22px on touch widths) with checked,
  indeterminate, hover, disabled and forced-colors fallbacks
- WeekPlanAssistant: drop fixed checkbox size so it matches the rest

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Loma Bot Ops
2026-11-22 21:52:10 +07:00
parent 6994ba1a4e
commit 5625c9a0e2
2 changed files with 176 additions and 2 deletions
+175 -1
View File
@@ -258,7 +258,6 @@
.login-form .input { height: 46px; } .login-form .input { height: 46px; }
.login-divider { display: flex; align-items: center; gap: 12px; color: var(--ink-4); font-size: 12px; } .login-divider { display: flex; align-items: center; gap: 12px; color: var(--ink-4); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); } .login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
input[type="checkbox"] { accent-color: var(--m-blue); }
@media (max-width: 1199px) { @media (max-width: 1199px) {
.welcome-panel { padding: 28px; gap: 24px; } .welcome-panel { padding: 28px; gap: 24px; }
.workflow-preview { padding: 18px; } .workflow-preview { padding: 18px; }
@@ -513,6 +512,14 @@
.textarea::placeholder { .textarea::placeholder {
color: var(--ink-4); color: var(--ink-4);
} }
.input:disabled,
.select:disabled,
.textarea:disabled {
background: var(--board);
border-color: var(--line-2);
color: var(--ink-3);
cursor: not-allowed;
}
@media (max-width: 959px) { @media (max-width: 959px) {
.input, .input,
.select, .select,
@@ -525,6 +532,168 @@
} }
} }
/* ---------- date / datetime-local ----------
The browser's own popup can't be themed, so the field and its calendar
button are: segments highlight in the action blue, the icon is ours. */
.input[type="date"],
.input[type="datetime-local"] {
-webkit-appearance: none;
appearance: none;
display: flex;
align-items: center;
position: relative;
min-width: 0;
padding-inline-end: 40px; /* room for the calendar button */
text-align: start;
accent-color: var(--m-blue);
}
.input[type="date"]::-webkit-datetime-edit,
.input[type="datetime-local"]::-webkit-datetime-edit {
flex: 1 1 auto;
min-width: 0;
}
.input[type="date"]::-webkit-datetime-edit,
.input[type="datetime-local"]::-webkit-datetime-edit,
.input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
padding: 0;
}
.input[type="date"]::-webkit-datetime-edit-text,
.input[type="datetime-local"]::-webkit-datetime-edit-text {
padding: 0 1px;
color: var(--ink-4);
}
.input[type="date"]::-webkit-datetime-edit-year-field,
.input[type="date"]::-webkit-datetime-edit-month-field,
.input[type="date"]::-webkit-datetime-edit-day-field,
.input[type="datetime-local"]::-webkit-datetime-edit-year-field,
.input[type="datetime-local"]::-webkit-datetime-edit-month-field,
.input[type="datetime-local"]::-webkit-datetime-edit-day-field,
.input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
.input[type="datetime-local"]::-webkit-datetime-edit-minute-field,
.input[type="datetime-local"]::-webkit-datetime-edit-ampm-field {
padding: 2px 3px;
border-radius: 5px;
}
.input[type="date"]::-webkit-datetime-edit-year-field:focus,
.input[type="date"]::-webkit-datetime-edit-month-field:focus,
.input[type="date"]::-webkit-datetime-edit-day-field:focus,
.input[type="datetime-local"]::-webkit-datetime-edit-year-field:focus,
.input[type="datetime-local"]::-webkit-datetime-edit-month-field:focus,
.input[type="datetime-local"]::-webkit-datetime-edit-day-field:focus,
.input[type="datetime-local"]::-webkit-datetime-edit-hour-field:focus,
.input[type="datetime-local"]::-webkit-datetime-edit-minute-field:focus,
.input[type="datetime-local"]::-webkit-datetime-edit-ampm-field:focus {
background: var(--m-blue);
color: #fff;
outline: none;
}
.input[type="date"]::-webkit-calendar-picker-indicator,
.input[type="datetime-local"]::-webkit-calendar-picker-indicator {
box-sizing: border-box;
position: absolute;
inset-inline-end: 11px;
top: 50%;
translate: 0 -50%;
width: 20px;
height: 20px;
margin: 0;
padding: 0;
cursor: pointer;
opacity: 1;
background: var(--ink-3);
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
transition: background-color 0.15s;
}
.input[type="date"]::-webkit-calendar-picker-indicator:hover,
.input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
.input[type="date"]:focus::-webkit-calendar-picker-indicator,
.input[type="datetime-local"]:focus::-webkit-calendar-picker-indicator {
background: var(--m-blue);
}
.input[type="date"]:disabled::-webkit-calendar-picker-indicator,
.input[type="datetime-local"]:disabled::-webkit-calendar-picker-indicator {
background: var(--ink-4);
cursor: not-allowed;
}
@media (max-width: 959px) {
.input[type="date"],
.input[type="datetime-local"] {
padding-inline-end: 48px;
}
.input[type="date"]::-webkit-calendar-picker-indicator,
.input[type="datetime-local"]::-webkit-calendar-picker-indicator {
inset-inline-end: 9px;
width: 28px;
height: 28px;
-webkit-mask-size: 20px 20px;
mask-size: 20px 20px;
}
}
/* ---------- checkbox ---------- */
input[type="checkbox"] {
-webkit-appearance: none;
appearance: none;
flex-shrink: 0;
width: 18px;
height: 18px;
margin: 0;
border: 1.5px solid var(--ink-3);
border-radius: 5px;
background-color: var(--paper);
background-position: center;
background-repeat: no-repeat;
background-size: 14px 14px;
cursor: pointer;
transition: background-color 0.15s, border-color 0.15s;
}
input[type="checkbox"]:hover:not(:disabled) {
border-color: var(--m-blue);
background-color: var(--m-blue-soft);
}
input[type="checkbox"]:checked,
input[type="checkbox"]:indeterminate {
border-color: var(--m-blue);
background-color: var(--m-blue);
}
input[type="checkbox"]:checked {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5'/%3E%3C/svg%3E");
}
input[type="checkbox"]:indeterminate {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M4 8h8'/%3E%3C/svg%3E");
}
input[type="checkbox"]:checked:hover:not(:disabled),
input[type="checkbox"]:indeterminate:hover:not(:disabled) {
border-color: var(--m-blue-ink);
background-color: var(--m-blue-ink);
}
input[type="checkbox"]:disabled {
cursor: not-allowed;
border-color: var(--line);
background-color: var(--line-2);
}
input[type="checkbox"]:disabled:checked {
border-color: var(--ink-4);
background-color: var(--ink-4);
}
@media (max-width: 959px) {
input[type="checkbox"] {
width: 22px;
height: 22px;
background-size: 16px 16px;
}
}
@media (forced-colors: active) {
input[type="checkbox"] {
-webkit-appearance: auto;
appearance: auto;
}
}
.chip { .chip {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
@@ -1072,6 +1241,11 @@
} }
@media (prefers-reduced-motion: reduce) { @media (prefers-reduced-motion: reduce) {
input[type="checkbox"],
.input[type="date"]::-webkit-calendar-picker-indicator,
.input[type="datetime-local"]::-webkit-calendar-picker-indicator {
transition: none;
}
.sheet, .sheet,
.scrim, .scrim,
.toast, .toast,
+1 -1
View File
@@ -131,7 +131,7 @@ export function WeekPlanAssistant({ pageId, pageName, week, openDays }: { pageId
<label className="flex gap-3 rounded-[12px] border border-line bg-paper p-3 cursor-pointer has-[:checked]:border-blue"> <label className="flex gap-3 rounded-[12px] border border-line bg-paper p-3 cursor-pointer has-[:checked]:border-blue">
<input <input
type="checkbox" type="checkbox"
className="mt-1 w-4 h-4 shrink-0" className="mt-[3px]"
checked={picked[i] ?? false} checked={picked[i] ?? false}
onChange={(e) => setPicked((cur) => cur.map((v, j) => (j === i ? e.target.checked : v)))} onChange={(e) => setPicked((cur) => cur.map((v, j) => (j === i ? e.target.checked : v)))}
/> />