mirror of
https://github.com/docmost/docmost.git
synced 2026-08-25 15:57:11 +08:00
64 lines
2.4 KiB
CSS
64 lines
2.4 KiB
CSS
/*
|
|
* Accessibility-driven overrides on top of Mantine's default component styles.
|
|
* Each rule documents the WCAG criterion it addresses and the measured
|
|
* contrast before/after.
|
|
*/
|
|
|
|
/* Mantine's default disabled menu item uses opacity: 0.5 on the active text
|
|
* color, which collapses to ~3.94:1 on white — below WCAG AA 4.5:1.
|
|
* (WCAG 1.4.3 exempts "inactive" UI components, but the text becomes hard
|
|
* to read.) Force opacity back to 1 and use the dimmed color so the item
|
|
* still feels subdued vs. active items but is comfortably readable
|
|
* (~7.56:1 on white).
|
|
*/
|
|
.mantine-Menu-item[data-disabled] {
|
|
opacity: 1;
|
|
color: var(--mantine-color-dimmed);
|
|
}
|
|
|
|
/* Mantine variant="default" inputs ship with --mantine-color-default-border
|
|
* = gray.4 (#ced4da), which on white is only 1.49:1 — fails WCAG AA 3:1
|
|
* for non-text. Bump to gray.6 (3.32:1) on the input itself rather than
|
|
* overriding the variable globally, because the same variable backs Card
|
|
* borders, dividers, and other subtle outlines we want to keep airy.
|
|
*/
|
|
.mantine-Input-input[data-variant="default"] {
|
|
border-color: var(--mantine-color-gray-6);
|
|
}
|
|
|
|
/* better contrast for disabled inputs */
|
|
.mantine-Input-input:disabled,
|
|
.mantine-Input-input[data-disabled] {
|
|
opacity: 0.7;
|
|
color: var(--mantine-color-dimmed);
|
|
-webkit-text-fill-color: var(--mantine-color-dimmed);
|
|
}
|
|
|
|
/* Spotlight's selected action ships as primary-filled blue with white text,
|
|
* but our custom action children (gray badge, dimmed snippet, gray icons)
|
|
* keep their light-surface colors on it and drop below WCAG AA 4.5:1
|
|
* (WCAG 1.4.3). Use a gray selection one step above the gray-0/dark-6
|
|
* hover instead - it matches the app's selection styling (we use no blue
|
|
* fills) and keeps every child at its already-passing resting contrast.
|
|
*/
|
|
.mantine-Spotlight-action[data-selected] {
|
|
background-color: light-dark(
|
|
var(--mantine-color-gray-1),
|
|
var(--mantine-color-dark-5)
|
|
);
|
|
color: var(--mantine-color-text);
|
|
--action-description-color: var(--mantine-color-dimmed);
|
|
--action-description-opacity: 1;
|
|
}
|
|
|
|
/* Result actions are tab stops (tabIndex restored via ref); give keyboard
|
|
* focus the same gray treatment as arrow-key selection so both navigation
|
|
* modes read identically (WCAG 2.4.7 focus visible).
|
|
*/
|
|
.mantine-Spotlight-action:focus-visible {
|
|
background-color: light-dark(
|
|
var(--mantine-color-gray-1),
|
|
var(--mantine-color-dark-5)
|
|
);
|
|
}
|