|
3 | 3 | import { createTheme } from "@mui/material";
|
4 | 4 | import baseTheme from "./theme";
|
5 | 5 | import { mergeThemes } from "./util/styles";
|
6 |
| -import { darken, alpha } from "@mui/system"; |
| 6 | +import { darken, alpha, lighten } from "@mui/system"; |
7 | 7 | import { toolbarClasses } from "@mui/material/Toolbar";
|
8 | 8 | import { typographyClasses } from "@mui/material/Typography";
|
9 | 9 | import { svgIconClasses } from "@mui/material/SvgIcon";
|
@@ -94,11 +94,17 @@ export default function createAccentedTheme(accent: AccentColor): { ... } {
|
94 | 94 | const mainAccentColor = prefersMoreContrast
|
95 | 95 | ? "rgb(0,0,0)"
|
96 | 96 | : `hsl(${accent.main.hue}deg, ${accent.main.saturation}%, ${accent.main.lightness}%)`;
|
97 |
| - const disabledColor = `hsl(${accent.main.hue}deg, 10%, 86%)`; |
| 97 | + const disabledColor = lighten( |
| 98 | + `hsl(${accent.main.hue}deg, 10%, ${accent.main.lightness}%)`, |
| 99 | + 0.5 |
| 100 | + ); |
98 | 101 |
|
99 | 102 | const linkButtonText = prefersMoreContrast
|
100 | 103 | ? "rgb(0,0,0)"
|
101 |
| - : `hsl(${accent.main.hue}deg, ${accent.main.saturation}%, 40%)`; |
| 104 | + : darken( |
| 105 | + `hsl(${accent.main.hue}deg, ${accent.main.saturation}%, ${accent.main.lightness}%)`, |
| 106 | + 0.5 |
| 107 | + ); |
102 | 108 |
|
103 | 109 | /**
|
104 | 110 | * A background colour that can be used behind headers, toolbars, and other
|
@@ -211,14 +217,18 @@ export default function createAccentedTheme(accent: AccentColor): { ... } {
|
211 | 217 | [`&:has(.${inputAdornmentClasses.positionStart})`]: {
|
212 | 218 | paddingLeft: 0,
|
213 | 219 | },
|
214 |
| - [`& .${svgIconClasses.root}`]: { |
215 |
| - fill: prefersMoreContrast |
216 |
| - ? "rgb(0,0,0)" |
217 |
| - : contrastTextColor, |
| 220 | + [`& .${inputAdornmentClasses.root}`]: { |
| 221 | + paddingLeft: baseTheme.spacing(1), |
| 222 | + paddingRight: baseTheme.spacing(1), |
| 223 | + [`& .${svgIconClasses.root}`]: { |
| 224 | + fill: prefersMoreContrast |
| 225 | + ? "rgb(0,0,0)" |
| 226 | + : contrastTextColor, |
| 227 | + }, |
218 | 228 | },
|
219 | 229 | "& input": {
|
220 | 230 | padding: baseTheme.spacing(0.5),
|
221 |
| - paddingLeft: 0, |
| 231 | + paddingLeft: baseTheme.spacing(1), |
222 | 232 | color: prefersMoreContrast
|
223 | 233 | ? "rgb(0,0,0)"
|
224 | 234 | : contrastTextColor,
|
@@ -452,19 +462,20 @@ export default function createAccentedTheme(accent: AccentColor): { ... } {
|
452 | 462 | [`& .${outlinedInputClasses.input}`]: {
|
453 | 463 | paddingTop: "5px",
|
454 | 464 | paddingBottom: "5px",
|
| 465 | + paddingLeft: baseTheme.spacing(1.5), |
455 | 466 | },
|
456 | 467 | },
|
457 | 468 | [`& .${inputAdornmentClasses.root}`]: {
|
458 | 469 | height: "100%",
|
459 |
| - paddingLeft: baseTheme.spacing(1), |
460 |
| - paddingRight: baseTheme.spacing(1), |
| 470 | + paddingLeft: baseTheme.spacing(1.5), |
| 471 | + paddingRight: baseTheme.spacing(1.5), |
461 | 472 | borderRight: accentedBorder,
|
462 |
| - backgroundColor: lighterInteractiveColor, |
| 473 | + marginRight: 0, |
463 | 474 | [`& .${typographyClasses.root}`]: {
|
464 | 475 | textTransform: "uppercase",
|
465 | 476 | fontWeight: 700,
|
466 |
| - fontSize: "0.9rem", |
467 |
| - lineHeight: "31px", |
| 477 | + fontSize: "0.8125rem", |
| 478 | + lineHeight: "20px", |
468 | 479 | },
|
469 | 480 | },
|
470 | 481 | },
|
|
0 commit comments