Skip to content

Commit 267f54d

Browse files
authored
[web] Fix link default prop for the (WIP) light mode (#4817)
This was causing an exception when opening screens with the <Link>
2 parents 6a4e992 + 1015c87 commit 267f54d

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

web/apps/photos/src/components/Collections/AlbumCastDialog.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export const AlbumCastDialog: React.FC<AlbumCastDialogProps> = ({
187187
{view == "pin" && (
188188
<>
189189
<Stack sx={{ gap: 2, mb: 2 }}>
190-
<Typography>
190+
<Typography sx={{ color: "text.muted" }}>
191191
<Trans
192192
i18nKey="visit_cast_url"
193193
components={{
@@ -196,7 +196,9 @@ export const AlbumCastDialog: React.FC<AlbumCastDialogProps> = ({
196196
values={{ url: castHost }}
197197
/>
198198
</Typography>
199-
<Typography>{t("enter_cast_pin_code")}</Typography>
199+
<Typography sx={{ color: "text.muted" }}>
200+
{t("enter_cast_pin_code")}
201+
</Typography>
200202
</Stack>
201203
<SingleInputForm
202204
callback={onSubmit}

web/packages/base/components/utils/theme.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ const getColorSchemes = (colors: ReturnType<typeof getColors>) => ({
296296
hover: colors.light.fill.faintHover,
297297
// For an icon button, the hover background color is derived
298298
// from the active color above and this opacity.
299-
hoverOpacity: 0.04,
299+
hoverOpacity: 0.06,
300300
// TODO(LM): Remove commented.
301301
// The color of a selected action.
302302
//
@@ -627,15 +627,21 @@ const components: Components = {
627627
},
628628
},
629629

630+
// The default link "color" prop is "primary", which maps to "fill.base"
631+
// (and equivalently, to "text.base"). In our current designs, the <Link>
632+
// MUI component is only used in places where the surrounding text uses
633+
// "text.muted", so this default already provides it a highlight compared to
634+
// the text it in embedded in.
635+
//
636+
// We additionally disable the underline, and add a hover indication by
637+
// switching its color to the main accent.
630638
MuiLink: {
631639
defaultProps: {
632-
color: "var(--mui-palette-accent-main)",
633640
underline: "none",
634641
},
635642
styleOverrides: {
636643
root: {
637644
"&:hover": {
638-
underline: "always",
639645
color: "var(--mui-palette-accent-main)",
640646
},
641647
},

0 commit comments

Comments
 (0)