Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Refactor Paste components to utilize theme tokens for styling

Aswin Asokdf7013e18b5d
diff --git a/web/apps/paste/public/arrow.json b/web/apps/paste/public/arrow.json
index d61e50e3f7..217b57b5b1 100644
--- a/web/apps/paste/public/arrow.json
+++ b/web/apps/paste/public/arrow.json
@@ -100,7 +100,7 @@
"ml": 1,
"o": { "a": 0, "k": 100, "ix": 4 },
"w": { "a": 0, "k": 4, "ix": 5 },
- "c": { "a": 0, "k": [1, 1, 1], "ix": 3 }
+ "c": { "a": 0, "k": [0.051, 0.063, 0.086], "ix": 3 }
},
{
"ty": "tr",
@@ -175,7 +175,7 @@
"ml": 4,
"o": { "a": 0, "k": 100, "ix": 4 },
"w": { "a": 0, "k": 4, "ix": 5 },
- "c": { "a": 0, "k": [1, 1, 1], "ix": 3 }
+ "c": { "a": 0, "k": [0.051, 0.063, 0.086], "ix": 3 }
},
{
"ty": "tr",
diff --git a/web/apps/paste/src/features/paste/components/PasteCreatePanel.tsx b/web/apps/paste/src/features/paste/components/PasteCreatePanel.tsx
index 62675c8a69..9011d4062e 100644
--- a/web/apps/paste/src/features/paste/components/PasteCreatePanel.tsx
+++ b/web/apps/paste/src/features/paste/components/PasteCreatePanel.tsx
@@ -8,6 +8,8 @@ import {
Typography,
} from "@mui/material";
import useMediaQuery from "@mui/material/useMediaQuery";
+import { usePasteColorMode } from "features/paste/hooks/usePasteColorMode";
+import { getPasteThemeTokens } from "features/paste/theme/pasteThemeTokens";
import { MAX_PASTE_CHARS } from "../constants";
import { PasteLinkCard } from "./PasteLinkCard";
import { pasteTextFieldSx } from "./textFieldSx";
@@ -34,15 +36,12 @@ export const PasteCreatePanel = ({
onShareLink,
}: PasteCreatePanelProps) => {
const isMobile = useMediaQuery("(max-width:599.95px)", { noSsr: true });
+ const { resolvedMode } = usePasteColorMode();
+ const tokens = getPasteThemeTokens(resolvedMode);
const isInputEmpty = inputText.trim().length === 0;
- const frameBlue = "#2f6df7";
- const inputGlassBg = "rgba(39, 42, 52, 0.76)";
- const inputGlassBorder = "rgba(213, 225, 255, 0.14)";
const nearLimitThreshold = Math.floor(MAX_PASTE_CHARS * 0.9);
const isNearCharLimit = inputText.length >= nearLimitThreshold;
const isCreateDisabled = isInputEmpty;
- const mutedCounterColor = "rgba(234, 238, 255, 0.6)";
- const softBlueCounterColor = "rgba(204, 224, 255, 0.96)";
const privacyPills = [
"Private",
isMobile ? "E2EE" : "End To End Encrypted",
@@ -80,11 +79,7 @@ export const PasteCreatePanel = ({
onInputChange(event.target.value);
}}
sx={[
- pasteTextFieldSx(
- "20px",
- inputGlassBg,
- inputGlassBorder,
- ),
+ pasteTextFieldSx(tokens, "20px"),
{
"& .MuiFilledInput-root": {
paddingTop: { xs: "12px", sm: "14px" },
@@ -95,25 +90,19 @@ export const PasteCreatePanel = ({
backdropFilter: "blur(9px) saturate(112%)",
WebkitBackdropFilter:
"blur(9px) saturate(112%)",
- background:
- "linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 58%, rgba(255, 255, 255, 0.015) 100%)",
- boxShadow:
- "0 12px 28px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.1)",
+ background: tokens.surface.inputGradient,
+ boxShadow: tokens.surface.inputShadow,
"&:hover": {
- bgcolor: inputGlassBg,
- borderColor: inputGlassBorder,
- background:
- "linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 58%, rgba(255, 255, 255, 0.015) 100%)",
- boxShadow:
- "0 12px 28px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.1)",
+ bgcolor: tokens.surface.inputBg,
+ borderColor: tokens.surface.inputBorder,
+ background: tokens.surface.inputGradient,
+ boxShadow: tokens.surface.inputShadow,
},
"&.Mui-focused": {
- bgcolor: inputGlassBg,
- borderColor: inputGlassBorder,
- background:
- "linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 58%, rgba(255, 255, 255, 0.015) 100%)",
- boxShadow:
- "0 12px 28px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.1)",
+ bgcolor: tokens.surface.inputBg,
+ borderColor: tokens.surface.inputBorder,
+ background: tokens.surface.inputGradient,
+ boxShadow: tokens.surface.inputShadow,
},
},
"& .MuiInputBase-input": {
@@ -143,7 +132,7 @@ export const PasteCreatePanel = ({
display: "flex",
alignItems: "center",
height: { xs: 32, sm: 36 },
- color: mutedCounterColor,
+ color: tokens.text.counter,
fontWeight: 600,
lineHeight: 1,
letterSpacing: "0.01em",
@@ -153,13 +142,13 @@ export const PasteCreatePanel = ({
component="span"
sx={{
color: isNearCharLimit
- ? softBlueCounterColor
- : mutedCounterColor,
+ ? tokens.text.counterHighlight
+ : tokens.text.counter,
}}
>
{inputText.length}
</Box>
- <Box component="span" sx={{ color: mutedCounterColor }}>
+ <Box component="span" sx={{ color: tokens.text.counter }}>
/{MAX_PASTE_CHARS}
</Box>
</Typography>
@@ -178,20 +167,16 @@ export const PasteCreatePanel = ({
marginBottom: { xs: "3px", sm: "4px" },
marginRight: { xs: "-1px", sm: "-2px" },
borderRadius: { xs: "12px", sm: "14px" },
- bgcolor: frameBlue,
- color: "#f4f7ff",
+ bgcolor: tokens.button.primaryBg,
+ color: tokens.button.primaryText,
boxShadow: "none",
"&:hover": {
- bgcolor: frameBlue,
+ bgcolor: tokens.button.primaryHoverBg,
boxShadow: "none",
},
"&.Mui-disabled": {
- bgcolor: isCreateDisabled
- ? "rgba(255, 255, 255, 0.18)"
- : "rgba(47, 109, 247, 0.45)",
- color: isCreateDisabled
- ? "rgba(230, 236, 255, 0.44)"
- : "rgba(244, 247, 255, 0.72)",
+ bgcolor: tokens.button.primaryDisabledBg,
+ color: tokens.button.primaryDisabledText,
},
}}
>
@@ -199,7 +184,7 @@ export const PasteCreatePanel = ({
<CircularProgress
size={17}
thickness={5.2}
- sx={{ color: "rgba(244, 247, 255, 0.95)" }}
+ sx={{ color: tokens.button.primaryText }}
/>
) : (
<Box
@@ -251,16 +236,15 @@ export const PasteCreatePanel = ({
px: { xs: 1.2, sm: 1.4 },
py: { xs: 0.45, sm: 0.6 },
borderRadius: "999px",
- border: "1px solid rgba(147, 155, 177, 0.24)",
- bgcolor: "rgba(255, 255, 255, 0.045)",
- color: "rgba(220, 229, 255, 0.55)",
+ border: `1px solid ${tokens.surface.chipBorder}`,
+ bgcolor: tokens.surface.chipBg,
+ color: tokens.surface.chipText,
fontSize: { xs: "0.74rem", sm: "0.79rem" },
fontWeight: 600,
letterSpacing: "0.01em",
lineHeight: 1.2,
whiteSpace: "nowrap",
- boxShadow:
- "inset 0 1px 0 rgba(255, 255, 255, 0.05)",
+ boxShadow: tokens.surface.chipInsetShadow,
opacity: 0.78,
}}
>
diff --git a/web/apps/paste/src/features/paste/components/PasteFooter.tsx b/web/apps/paste/src/features/paste/components/PasteFooter.tsx
index b8a893b7d6..e17a0a057a 100644
--- a/web/apps/paste/src/features/paste/components/PasteFooter.tsx
+++ b/web/apps/paste/src/features/paste/components/PasteFooter.tsx
@@ -1,13 +1,15 @@
import { Box, Stack, Typography } from "@mui/material";
import { EnteLogo } from "ente-base/components/EnteLogo";
+import { usePasteColorMode } from "features/paste/hooks/usePasteColorMode";
+import { getPasteThemeTokens } from "features/paste/theme/pasteThemeTokens";
-const productLinkSx = (hoverColor: string) => ({
- color: "rgba(230, 236, 255, 0.82)",
+const productLinkSx = (color: string, hoverColor: string) => ({
+ color,
fontWeight: 700,
fontSize: { xs: "0.74rem", sm: "0.8rem" },
letterSpacing: "0.03em",
textDecoration: "underline",
- textDecorationColor: "rgba(230, 236, 255, 0.5)",
+ textDecorationColor: "currentColor",
textUnderlineOffset: "3px",
cursor: "pointer",
whiteSpace: "nowrap",
@@ -19,81 +21,86 @@ const productLinkSx = (hoverColor: string) => ({
},
});
-export const PasteFooter = () => (
- <Stack
- alignItems="center"
- spacing={1.1}
- >
- <Box
- component="a"
- href="https://ente.io"
- target="_blank"
- rel="noopener"
- aria-label="Ente"
- sx={{
- lineHeight: 0,
- color: "rgba(236, 243, 255, 0.92)",
- transition: "color 180ms ease",
- "&:hover": {
- color: "#08C225",
- },
- }}
- >
- <EnteLogo height={26} />
- </Box>
+export const PasteFooter = () => {
+ const { resolvedMode } = usePasteColorMode();
+ const tokens = getPasteThemeTokens(resolvedMode);
+ return (
<Stack
- direction="row"
- spacing={1}
alignItems="center"
- justifyContent="center"
- flexWrap="nowrap"
+ spacing={1.1}
>
- <Typography
+ <Box
component="a"
href="https://ente.io"
target="_blank"
rel="noopener"
- sx={productLinkSx("#08C225")}
- >
- Photos
- </Typography>
- <Box
- component="span"
+ aria-label="Ente"
sx={{
- width: 5,
- height: 5,
- borderRadius: "50%",
- bgcolor: "rgba(230, 236, 255, 0.52)",
+ lineHeight: 0,
+ color: tokens.text.footer,
+ transition: "color 180ms ease",
+ "&:hover": {
+ color: "#08C225",
+ },
}}
- />
- <Typography
- component="a"
- href="https://ente.io/locker"
- target="_blank"
- rel="noopener"
- sx={productLinkSx("#076AE2")}
>
- Documents
- </Typography>
- <Box
- component="span"
- sx={{
- width: 5,
- height: 5,
- borderRadius: "50%",
- bgcolor: "rgba(230, 236, 255, 0.52)",
- }}
- />
- <Typography
- component="a"
- href="https://ente.io/auth"
- target="_blank"
- rel="noopener"
- sx={productLinkSx("#A75CFF")}
+ <EnteLogo height={26} />
+ </Box>
+
+ <Stack
+ direction="row"
+ spacing={1}
+ alignItems="center"
+ justifyContent="center"
+ flexWrap="nowrap"
>
- Auth
- </Typography>
+ <Typography
+ component="a"
+ href="https://ente.io"
+ target="_blank"
+ rel="noopener"
+ sx={productLinkSx(tokens.text.footer, "#08C225")}
+ >
+ Photos
+ </Typography>
+ <Box
+ component="span"
+ sx={{
+ width: 5,
+ height: 5,
+ borderRadius: "50%",
+ bgcolor: tokens.text.footerDot,
+ }}
+ />
+ <Typography
+ component="a"
+ href="https://ente.io/locker"
+ target="_blank"
+ rel="noopener"
+ sx={productLinkSx(tokens.text.footer, "#076AE2")}
+ >
+ Documents
+ </Typography>
+ <Box
+ component="span"
+ sx={{
+ width: 5,
+ height: 5,
+ borderRadius: "50%",
+ bgcolor: tokens.text.footerDot,
+ }}
+ />
+ <Typography
+ component="a"
+ href="https://ente.io/auth"
+ target="_blank"
+ rel="noopener"
+ sx={productLinkSx(tokens.text.footer, "#A75CFF")}
+ >
+ Auth
+ </Typography>
+ </Stack>
</Stack>
- </Stack>
-);
+ );
+};
diff --git a/web/apps/paste/src/features/paste/components/PasteFrame.tsx b/web/apps/paste/src/features/paste/components/PasteFrame.tsx
index b88c04c6ce..b1941acc9b 100644
--- a/web/apps/paste/src/features/paste/components/PasteFrame.tsx
+++ b/web/apps/paste/src/features/paste/components/PasteFrame.tsx
@@ -1,5 +1,10 @@
+import DarkModeRoundedIcon from "@mui/icons-material/DarkModeRounded";
import GitHubIcon from "@mui/icons-material/GitHub";
-import { Box, IconButton } from "@mui/material";
+import LightModeRoundedIcon from "@mui/icons-material/LightModeRounded";
+import { Box, IconButton, Stack, Typography } from "@mui/material";
+import { EnteLogo } from "ente-base/components/EnteLogo";
+import { usePasteColorMode } from "features/paste/hooks/usePasteColorMode";
+import { getPasteThemeTokens } from "features/paste/theme/pasteThemeTokens";
import type { ReactNode } from "react";
interface PasteFrameProps {
@@ -7,111 +12,159 @@ interface PasteFrameProps {
footer: ReactNode;
}
-export const PasteFrame = ({ children, footer }: PasteFrameProps) => (
- <Box
- sx={{
- minHeight: "100dvh",
- width: "100%",
- maxWidth: "100%",
- bgcolor: "#2f6df7",
- fontFamily: '"Inter Variable", sans-serif',
- display: "flex",
- flexDirection: "column",
- alignItems: "stretch",
- p: { xs: 1.25, md: 2 },
- boxSizing: "border-box",
- overflowX: "hidden",
- }}
- >
+export const PasteFrame = ({ children, footer }: PasteFrameProps) => {
+ const { resolvedMode, setMode } = usePasteColorMode();
+ const tokens = getPasteThemeTokens(resolvedMode);
+ const ActiveModeIcon =
+ resolvedMode === "light" ? LightModeRoundedIcon : DarkModeRoundedIcon;
+
+ return (
<Box
sx={{
- position: "relative",
- minHeight: {
- xs: "calc(100dvh - 20px)",
- md: "calc(100dvh - 32px)",
- },
- flex: 1,
+ minHeight: "100dvh",
width: "100%",
maxWidth: "100%",
- bgcolor: "#0d1016",
- borderRadius: { xs: "24px", md: "34px" },
- display: "grid",
- gridTemplateRows: "auto 1fr auto",
+ bgcolor: tokens.frame.outerBg,
+ fontFamily: '"Inter Variable", sans-serif',
+ display: "flex",
+ flexDirection: "column",
alignItems: "stretch",
- boxShadow: "inset 0 0 0 1px rgba(255, 255, 255, 0.04)",
+ p: { xs: 1.25, md: 2 },
+ boxSizing: "border-box",
overflowX: "hidden",
- "& ::selection": {
- backgroundColor: "#2f6df7",
- color: "#ffffff",
- },
- "& ::-moz-selection": {
- backgroundColor: "#2f6df7",
- color: "#ffffff",
- },
}}
>
<Box
sx={{
+ position: "relative",
+ minHeight: {
+ xs: "calc(100dvh - 20px)",
+ md: "calc(100dvh - 32px)",
+ },
+ flex: 1,
width: "100%",
- display: "flex",
- alignItems: "center",
- justifyContent: "space-between",
- px: { xs: 3, md: 4.5 },
- pt: { xs: 3, md: 3.5 },
+ maxWidth: "100%",
+ bgcolor: tokens.frame.innerBg,
+ borderRadius: { xs: "24px", md: "34px" },
+ display: "grid",
+ gridTemplateRows: "auto 1fr auto",
+ alignItems: "stretch",
+ boxShadow: `inset 0 0 0 1px ${tokens.frame.innerBorder}`,
+ overflowX: "hidden",
+ "& ::selection": {
+ backgroundColor: tokens.frame.selectionBg,
+ color: tokens.frame.selectionText,
+ },
+ "& ::-moz-selection": {
+ backgroundColor: tokens.frame.selectionBg,
+ color: tokens.frame.selectionText,
+ },
}}
>
<Box
- component="img"
- src="/images/pastelogo.png"
- alt="Ente Paste"
sx={{
- display: "block",
- width: "auto",
- height: { xs: 34, md: 40 },
- maxWidth: { xs: 220, md: 260 },
+ width: "100%",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "space-between",
+ px: { xs: 3, md: 4.5 },
+ pt: { xs: 3, md: 3.5 },
}}
- />
- <IconButton
- component="a"
- href="https://github.com/ente-io/ente"
- target="_blank"
- rel="noopener noreferrer"
- aria-label="View source on GitHub"
+ >
+ <Stack
+ direction="row"
+ alignItems="center"
+ spacing={0.35}
+ sx={{
+ color: tokens.frame.logoTint,
+ lineHeight: 0,
+ }}
+ >
+ <Box>
+ <EnteLogo height={22} />
+ </Box>
+ <Typography
+ component="span"
+ sx={{
+ fontFamily:
+ '"Gochi Hand", "Comic Sans MS", "Bradley Hand", cursive',
+ fontSize: { xs: "1.92rem", md: "2.16rem" },
+ lineHeight: 1,
+ letterSpacing: "0.01em",
+ color: tokens.frame.logoTint,
+ mt: { xs: "2px", md: "3px" },
+ }}
+ >
+ paste
+ </Typography>
+ </Stack>
+ <Stack direction="row" spacing={0.85} alignItems="center">
+ <IconButton
+ onClick={() => {
+ setMode(
+ resolvedMode === "dark"
+ ? "light"
+ : "dark",
+ );
+ }}
+ aria-label="Toggle color mode"
+ sx={{
+ width: 48,
+ height: 48,
+ bgcolor: "transparent",
+ color: tokens.frame.headerIcon,
+ "&:hover": {
+ bgcolor: "transparent",
+ },
+ }}
+ >
+ <ActiveModeIcon sx={{ fontSize: 26 }} />
+ </IconButton>
+ <IconButton
+ component="a"
+ href="https://github.com/ente-io/ente"
+ target="_blank"
+ rel="noopener noreferrer"
+ aria-label="View source on GitHub"
+ sx={{
+ width: 42,
+ height: 42,
+ bgcolor: "transparent",
+ color: tokens.frame.headerIcon,
+ "&:hover": {
+ bgcolor: tokens.frame.headerIconHoverBg,
+ },
+ }}
+ >
+ <GitHubIcon sx={{ fontSize: 30 }} />
+ </IconButton>
+ </Stack>
+ </Box>
+ <Box
sx={{
- width: 42,
- height: 42,
- bgcolor: "transparent",
- color: "#f4f7ff",
- "&:hover": { bgcolor: "rgba(255, 255, 255, 0.12)" },
+ width: "100%",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ px: { xs: 3, md: 5 },
+ py: { xs: 2, md: 3 },
}}
>
- <GitHubIcon sx={{ fontSize: 30 }} />
- </IconButton>
- </Box>
- <Box
- sx={{
- width: "100%",
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
- px: { xs: 3, md: 5 },
- py: { xs: 2, md: 3 },
- }}
- >
- <Box sx={{ width: "100%", maxWidth: 700 }}>{children}</Box>
- </Box>
- <Box
- sx={{
- width: "100%",
- maxWidth: 700,
- mx: "auto",
- px: { xs: 3, md: 5 },
- pt: { xs: 2, md: 2.5 },
- pb: { xs: 3, md: 3.25 },
- }}
- >
- {footer}
+ <Box sx={{ width: "100%", maxWidth: 700 }}>{children}</Box>
+ </Box>
+ <Box
+ sx={{
+ width: "100%",
+ maxWidth: 700,
+ mx: "auto",
+ px: { xs: 3, md: 5 },
+ pt: { xs: 2, md: 2.5 },
+ pb: { xs: 3, md: 3.25 },
+ }}
+ >
+ {footer}
+ </Box>
</Box>
</Box>
- </Box>
-);
+ );
+};
diff --git a/web/apps/paste/src/features/paste/components/PasteHero.tsx b/web/apps/paste/src/features/paste/components/PasteHero.tsx
index 539059e2d8..5b36abce4b 100644
--- a/web/apps/paste/src/features/paste/components/PasteHero.tsx
+++ b/web/apps/paste/src/features/paste/components/PasteHero.tsx
@@ -1,14 +1,21 @@
import { Typography } from "@mui/material";
+import { usePasteColorMode } from "features/paste/hooks/usePasteColorMode";
+import { getPasteThemeTokens } from "features/paste/theme/pasteThemeTokens";
-export const PasteHero = () => (
- <Typography
- sx={{
- fontSize: { xs: "2rem", md: "2.3rem" },
- lineHeight: 1.05,
- fontWeight: 700,
- color: "#f4f7ff",
- }}
- >
- Ente Paste
- </Typography>
-);
+export const PasteHero = () => {
+ const { resolvedMode } = usePasteColorMode();
+ const tokens = getPasteThemeTokens(resolvedMode);
+
+ return (
+ <Typography
+ sx={{
+ fontSize: { xs: "2rem", md: "2.3rem" },
+ lineHeight: 1.05,
+ fontWeight: 700,
+ color: tokens.text.primary,
+ }}
+ >
+ Ente Paste
+ </Typography>
+ );
+};
diff --git a/web/apps/paste/src/features/paste/components/PasteLinkCard.tsx b/web/apps/paste/src/features/paste/components/PasteLinkCard.tsx
index 8fc396ab98..02ea9353b8 100644
--- a/web/apps/paste/src/features/paste/components/PasteLinkCard.tsx
+++ b/web/apps/paste/src/features/paste/components/PasteLinkCard.tsx
@@ -11,6 +11,8 @@ import {
Typography,
} from "@mui/material";
import useMediaQuery from "@mui/material/useMediaQuery";
+import { usePasteColorMode } from "features/paste/hooks/usePasteColorMode";
+import { getPasteThemeTokens } from "features/paste/theme/pasteThemeTokens";
import { useEffect, useMemo, useRef, useState } from "react";
import {
parseArrowLottie,
@@ -36,12 +38,12 @@ export const PasteLinkCard = ({
onCopy,
onShare,
}: PasteLinkCardProps) => {
- const inputGlassBg = "rgba(39, 42, 52, 0.76)";
- const inputGlassBorder = "rgba(213, 225, 255, 0.14)";
- const inputGlassSurface =
- "linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 58%, rgba(255, 255, 255, 0.015) 100%)";
- const inputGlassShadow =
- "0 12px 28px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.1)";
+ const { resolvedMode } = usePasteColorMode();
+ const tokens = getPasteThemeTokens(resolvedMode);
+ const inputGlassBg = tokens.surface.dialogBg;
+ const inputGlassBorder = tokens.surface.dialogBorder;
+ const inputGlassSurface = tokens.surface.inputGradient;
+ const inputGlassShadow = tokens.surface.inputShadow;
const linkCardRef = useRef<HTMLDivElement | null>(null);
const arrowSvgRef = useRef<SVGSVGElement | null>(null);
const [arrow, setArrow] = useState<ParsedArrow | null>(null);
@@ -208,6 +210,7 @@ export const PasteLinkCard = ({
handleCloseViewConfirm();
window.open(link, "_blank", "noopener,noreferrer");
};
+ const arrowStrokeColor = resolvedMode === "dark" ? "#ffffff" : null;
return (
<Stack
@@ -225,7 +228,7 @@ export const PasteLinkCard = ({
fontSize: "0.88rem",
fontWeight: 600,
letterSpacing: "0.01em",
- color: "rgba(220, 229, 255, 0.76)",
+ color: tokens.text.secondary,
maxWidth: "100%",
}}
>
@@ -256,11 +259,11 @@ export const PasteLinkCard = ({
px: { xs: 1.9, sm: 2.2 },
py: { xs: 1.05, sm: 1.2 },
borderRadius: "14px",
- border: "1px solid rgba(214, 226, 255, 0.16)",
- bgcolor: "rgba(255, 255, 255, 0.05)",
+ border: `1px solid ${tokens.surface.linkRowBorder}`,
+ bgcolor: tokens.surface.linkRowBg,
backdropFilter: "blur(8px) saturate(108%)",
WebkitBackdropFilter: "blur(8px) saturate(108%)",
- boxShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.08)",
+ boxShadow: tokens.surface.linkRowInsetShadow,
overflow: "hidden",
}}
>
@@ -283,7 +286,7 @@ export const PasteLinkCard = ({
maxWidth: "100%",
gap: 0.9,
minWidth: 0,
- color: "rgba(244, 247, 255, 0.9)",
+ color: tokens.text.primary,
textDecoration: "none",
fontSize: { xs: "0.9rem", sm: "0.93rem" },
lineHeight: 1.4,
@@ -291,7 +294,7 @@ export const PasteLinkCard = ({
overflow: "hidden",
"&:hover": {
textDecoration: "underline",
- color: "rgba(244, 247, 255, 1)",
+ color: tokens.text.primary,
},
}}
>
@@ -358,7 +361,7 @@ export const PasteLinkCard = ({
key={`${path.d}-mobile-${idx}`}
d={path.d}
fill="none"
- stroke={path.color}
+ stroke={arrowStrokeColor ?? path.color}
strokeWidth={
path.width * path.strokeScale
}
@@ -425,7 +428,7 @@ export const PasteLinkCard = ({
data-arrow-index={idx}
d={path.d}
fill="none"
- stroke={path.color}
+ stroke={arrowStrokeColor ?? path.color}
strokeWidth={
path.width * path.strokeScale
}
@@ -468,19 +471,19 @@ export const PasteLinkCard = ({
width: { xs: 36, sm: 40 },
height: { xs: 36, sm: 40 },
borderRadius: "11px",
- border: "1px solid rgba(244, 247, 255, 0.35)",
+ border: `1px solid ${tokens.button.qrToggleBorder}`,
bgcolor: showQr
- ? "rgba(244, 247, 255, 0.22)"
- : "rgba(244, 247, 255, 0.12)",
- color: "#f4f7ff",
+ ? tokens.button.qrToggleActiveBg
+ : tokens.button.qrToggleBg,
+ color: tokens.button.qrToggleText,
transform: {
xs: "translateY(4px) rotate(-4deg)",
sm: "translateY(74px) rotate(-4deg)",
},
"&:hover": {
bgcolor: showQr
- ? "rgba(244, 247, 255, 0.28)"
- : "rgba(244, 247, 255, 0.18)",
+ ? tokens.button.qrToggleActiveHoverBg
+ : tokens.button.qrToggleHoverBg,
},
}}
>
@@ -497,7 +500,7 @@ export const PasteLinkCard = ({
fontFamily:
'"Gochi Hand", "Comic Sans MS", "Bradley Hand", cursive',
fontSize: { xs: "2rem", sm: "2.5rem" },
- color: "#2f6df7",
+ color: tokens.button.scriptLink,
background: "none",
border: "none",
p: 0,
@@ -511,7 +514,7 @@ export const PasteLinkCard = ({
sm: "translateY(68px) rotate(-4deg)",
},
"&:hover": {
- color: "#5d92ff",
+ color: tokens.button.scriptLinkHover,
textDecoration: "underline",
textUnderlineOffset: "3px",
},
@@ -539,7 +542,7 @@ export const PasteLinkCard = ({
fontFamily:
'"Gochi Hand", "Comic Sans MS", "Bradley Hand", cursive',
fontSize: { xs: "2rem", sm: "2.5rem" },
- color: "#2f6df7",
+ color: tokens.button.scriptLink,
background: "none",
border: "none",
p: 0,
@@ -549,7 +552,7 @@ export const PasteLinkCard = ({
textDecoration: "underline",
textUnderlineOffset: "3px",
"&:hover": {
- color: "#5d92ff",
+ color: tokens.button.scriptLinkHover,
textDecoration: "underline",
textUnderlineOffset: "3px",
},
@@ -568,7 +571,7 @@ export const PasteLinkCard = ({
transform: "translateX(-50%)",
mt: 0.5,
whiteSpace: "nowrap",
- color: "rgba(182, 190, 208, 0.9)",
+ color: tokens.text.copied,
fontSize: "0.94rem",
fontWeight: 600,
lineHeight: 1,
@@ -591,9 +594,9 @@ export const PasteLinkCard = ({
zIndex: 1300,
p: 0.95,
borderRadius: "14px",
- border: "1px solid rgba(47, 109, 247, 0.4)",
- bgcolor: "rgba(47, 109, 247, 0.14)",
- boxShadow: "0 10px 24px rgba(0, 0, 0, 0.22)",
+ border: `1px solid ${tokens.surface.floatingCardBorder}`,
+ bgcolor: tokens.accent.soft,
+ boxShadow: tokens.surface.floatingCardShadow,
backdropFilter: "blur(8px) saturate(106%)",
WebkitBackdropFilter:
"blur(8px) saturate(106%)",
@@ -609,7 +612,7 @@ export const PasteLinkCard = ({
width: { xs: 144, sm: 168, md: 184 },
height: { xs: 144, sm: 168, md: 184 },
borderRadius: "10px",
- bgcolor: "#fff",
+ bgcolor: tokens.qr.paperBg,
p: 1,
}}
>
@@ -623,8 +626,8 @@ export const PasteLinkCard = ({
rx={module.finder ? 0.08 : 0.34}
fill={
module.finder
- ? "#1d3d9f"
- : "#2f6df7"
+ ? tokens.qr.finder
+ : tokens.qr.module
}
/>
))}
@@ -640,7 +643,7 @@ export const PasteLinkCard = ({
slotProps={{
backdrop: {
sx: {
- bgcolor: "rgba(5, 10, 24, 0.74)",
+ bgcolor: tokens.surface.dialogBackdrop,
backdropFilter: "blur(2px)",
},
},
@@ -671,7 +674,7 @@ export const PasteLinkCard = ({
position: "absolute",
top: 10,
right: 10,
- color: "rgba(225, 233, 255, 0.86)",
+ color: tokens.text.secondary,
}}
>
<CloseRoundedIcon fontSize="small" />
@@ -689,7 +692,7 @@ export const PasteLinkCard = ({
</Typography>
<Typography
sx={{
- color: "rgba(244, 247, 255, 0.95)",
+ color: tokens.text.primary,
fontWeight: 700,
fontSize: { xs: "1rem", sm: "1.06rem" },
lineHeight: 1.3,
@@ -701,7 +704,7 @@ export const PasteLinkCard = ({
<Typography
sx={{
mt: 1,
- color: "rgba(220, 229, 255, 0.82)",
+ color: tokens.text.dialogBody,
fontSize: { xs: "0.88rem", sm: "0.91rem" },
lineHeight: 1.5,
textAlign: "center",
@@ -727,12 +730,12 @@ export const PasteLinkCard = ({
py: 0.58,
px: 1.5,
borderRadius: "10px",
- borderColor: "rgba(214, 226, 255, 0.28)",
- color: "rgba(236, 242, 255, 0.95)",
+ borderColor: tokens.button.ghostBorder,
+ color: tokens.button.ghostText,
"&:hover": {
borderColor:
- "rgba(214, 226, 255, 0.44)",
- bgcolor: "rgba(255, 255, 255, 0.06)",
+ tokens.button.ghostHoverBorder,
+ bgcolor: tokens.button.ghostHoverBg,
},
}}
variant="outlined"
@@ -750,12 +753,11 @@ export const PasteLinkCard = ({
py: 0.58,
px: 1.5,
borderRadius: "10px",
- bgcolor: "#2f6df7",
- color: "#f4f7ff",
- boxShadow:
- "0 2px 8px rgba(47, 109, 247, 0.2)",
+ bgcolor: tokens.button.primaryBg,
+ color: tokens.button.primaryText,
+ boxShadow: "0 2px 8px rgba(47, 109, 247, 0.2)",
"&:hover": {
- bgcolor: "#4c86ff",
+ bgcolor: tokens.button.primaryHoverBg,
boxShadow:
"0 3px 10px rgba(47, 109, 247, 0.24)",
},
@@ -777,7 +779,7 @@ export const PasteLinkCard = ({
slotProps={{
backdrop: {
sx: {
- bgcolor: "rgba(5, 10, 24, 0.72)",
+ bgcolor: tokens.surface.qrBackdropMobile,
backdropFilter: "blur(2px)",
},
},
@@ -785,10 +787,9 @@ export const PasteLinkCard = ({
sx: {
m: 2,
borderRadius: "18px",
- border: "1px solid rgba(47, 109, 247, 0.44)",
- bgcolor: "rgba(9, 18, 48, 0.9)",
- boxShadow:
- "0 16px 40px rgba(0, 0, 0, 0.42)",
+ border: `1px solid ${tokens.surface.floatingCardBorder}`,
+ bgcolor: tokens.surface.floatingCardBg,
+ boxShadow: tokens.surface.floatingCardShadow,
},
},
}}
@@ -804,7 +805,7 @@ export const PasteLinkCard = ({
width: 226,
height: 226,
borderRadius: "12px",
- bgcolor: "#fff",
+ bgcolor: tokens.qr.mobilePaperBg,
p: 1.1,
}}
>
@@ -818,8 +819,8 @@ export const PasteLinkCard = ({
rx={module.finder ? 0.08 : 0.34}
fill={
module.finder
- ? "#1d3d9f"
- : "#2f6df7"
+ ? tokens.qr.finder
+ : tokens.qr.module
}
/>
))}
diff --git a/web/apps/paste/src/features/paste/components/PasteViewPanel.tsx b/web/apps/paste/src/features/paste/components/PasteViewPanel.tsx
index 173e94d070..0c785c9937 100644
--- a/web/apps/paste/src/features/paste/components/PasteViewPanel.tsx
+++ b/web/apps/paste/src/features/paste/components/PasteViewPanel.tsx
@@ -9,6 +9,8 @@ import {
TextField,
Typography,
} from "@mui/material";
+import { usePasteColorMode } from "features/paste/hooks/usePasteColorMode";
+import { getPasteThemeTokens } from "features/paste/theme/pasteThemeTokens";
import { pasteTextFieldSx } from "./textFieldSx";
interface PasteViewPanelProps {
@@ -24,9 +26,8 @@ export const PasteViewPanel = ({
resolvedText,
onCopyText,
}: PasteViewPanelProps) => {
- const frameBlue = "#2f6df7";
- const inputGlassBg = "rgba(39, 42, 52, 0.76)";
- const inputGlassBorder = "rgba(213, 225, 255, 0.14)";
+ const { resolvedMode } = usePasteColorMode();
+ const tokens = getPasteThemeTokens(resolvedMode);
return (
<>
@@ -44,13 +45,13 @@ export const PasteViewPanel = ({
size={58}
thickness={4.5}
sx={{
- color: "rgba(176, 198, 234, 0.76)",
+ color: tokens.status.spinner,
mb: { xs: 0.7, md: 0.9 },
}}
/>
<Typography
sx={{
- color: "rgba(201, 212, 236, 0.66)",
+ color: tokens.status.loadingTitle,
fontWeight: 600,
fontSize: { xs: "1rem", md: "1.1rem" },
lineHeight: 1.2,
@@ -63,7 +64,7 @@ export const PasteViewPanel = ({
<Typography
variant="mini"
sx={{
- color: "rgba(188, 201, 230, 0.44)",
+ color: tokens.status.loadingBody,
fontWeight: 500,
textAlign: "center",
}}
@@ -87,13 +88,13 @@ export const PasteViewPanel = ({
icon={Alert02Icon}
size={56}
strokeWidth={2}
- style={{ color: "rgba(180, 198, 232, 0.76)" }}
+ style={{ color: tokens.status.errorIcon }}
/>
<Stack spacing={{ xs: 2.2, md: 2.6 }} alignItems="center">
<Typography
sx={{
maxWidth: 560,
- color: "rgba(186, 201, 232, 0.46)",
+ color: tokens.status.errorBody,
fontWeight: 500,
fontSize: { xs: "0.85rem", md: "0.92rem" },
lineHeight: 1.3,
@@ -116,10 +117,10 @@ export const PasteViewPanel = ({
fontWeight: 600,
fontSize: "1rem",
lineHeight: 1,
- bgcolor: frameBlue,
- color: "rgba(231, 238, 252, 0.9)",
+ bgcolor: tokens.button.primaryBg,
+ color: tokens.button.primaryText,
"&:hover": {
- bgcolor: frameBlue,
+ bgcolor: tokens.button.primaryHoverBg,
boxShadow: "none",
},
}}
@@ -130,12 +131,12 @@ export const PasteViewPanel = ({
</Stack>
)}
- {!resolvedText && (
+ {resolvedText && (
<Stack spacing={1.8}>
<Typography
sx={{
fontSize: "0.82rem",
- color: "rgba(186, 201, 232, 0.56)",
+ color: tokens.text.muted,
fontWeight: 600,
letterSpacing: "0.01em",
}}
@@ -159,11 +160,7 @@ export const PasteViewPanel = ({
},
}}
sx={[
- pasteTextFieldSx(
- "20px",
- inputGlassBg,
- inputGlassBorder,
- ),
+ pasteTextFieldSx(tokens, "20px"),
{
"& .MuiFilledInput-root": {
paddingBottom: "72px",
@@ -173,25 +170,19 @@ export const PasteViewPanel = ({
"blur(9px) saturate(112%)",
WebkitBackdropFilter:
"blur(9px) saturate(112%)",
- background:
- "linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 58%, rgba(255, 255, 255, 0.015) 100%)",
- boxShadow:
- "0 12px 28px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.1)",
+ background: tokens.surface.inputGradient,
+ boxShadow: tokens.surface.inputShadow,
"&:hover": {
- bgcolor: inputGlassBg,
- borderColor: inputGlassBorder,
- background:
- "linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 58%, rgba(255, 255, 255, 0.015) 100%)",
- boxShadow:
- "0 12px 28px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.1)",
+ bgcolor: tokens.surface.inputBg,
+ borderColor: tokens.surface.inputBorder,
+ background: tokens.surface.inputGradient,
+ boxShadow: tokens.surface.inputShadow,
},
"&.Mui-focused": {
- bgcolor: inputGlassBg,
- borderColor: inputGlassBorder,
- background:
- "linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 58%, rgba(255, 255, 255, 0.015) 100%)",
- boxShadow:
- "0 12px 28px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.1)",
+ bgcolor: tokens.surface.inputBg,
+ borderColor: tokens.surface.inputBorder,
+ background: tokens.surface.inputGradient,
+ boxShadow: tokens.surface.inputShadow,
},
},
},
@@ -215,9 +206,6 @@ export const PasteViewPanel = ({
size="small"
disableElevation
onClick={() => {
- if (resolvedText === null) {
- return;
- }
void onCopyText(resolvedText).catch(() => {
// Ignore errors to avoid unhandled rejections in click handlers.
});
@@ -235,12 +223,12 @@ export const PasteViewPanel = ({
textTransform: "none",
fontWeight: 600,
fontSize: "0.78rem",
- bgcolor: frameBlue,
- color: "rgba(231, 238, 252, 0.9)",
+ bgcolor: tokens.button.primaryBg,
+ color: tokens.button.primaryText,
boxShadow: "none",
"& .MuiButton-startIcon": { mr: 0.6 },
"&:hover": {
- bgcolor: frameBlue,
+ bgcolor: tokens.button.primaryHoverBg,
boxShadow: "none",
},
}}
@@ -252,7 +240,7 @@ export const PasteViewPanel = ({
<Typography
variant="mini"
sx={{
- color: "rgba(182, 197, 229, 0.44)",
+ color: tokens.status.deletedNote,
fontWeight: 500,
}}
>
diff --git a/web/apps/paste/src/features/paste/components/textFieldSx.ts b/web/apps/paste/src/features/paste/components/textFieldSx.ts
index 14c3fa29b9..f4c66990b5 100644
--- a/web/apps/paste/src/features/paste/components/textFieldSx.ts
+++ b/web/apps/paste/src/features/paste/components/textFieldSx.ts
@@ -1,32 +1,35 @@
+import type { PasteThemeTokens } from "../theme/pasteThemeTokens";
+
+type PasteTextFieldTokens = Pick<PasteThemeTokens, "accent" | "surface" | "text">;
+
export const pasteTextFieldSx = (
+ tokens: PasteTextFieldTokens,
radius = "16px",
- bgColor = "#24262c",
- borderColor = "rgba(255, 255, 255, 0.12)",
) => ({
margin: 0,
"& .MuiFilledInput-root": {
borderRadius: radius,
- bgcolor: bgColor,
+ bgcolor: tokens.surface.inputBg,
border: "1px solid",
- borderColor,
+ borderColor: tokens.surface.inputBorder,
alignItems: "flex-start",
boxSizing: "border-box",
- color: "#f4f7ff",
+ color: tokens.text.primary,
padding: "14px",
transition: "border-color 180ms ease, box-shadow 180ms ease",
"&:before": { display: "none" },
"&:after": { display: "none" },
"&:hover:not(.Mui-disabled, .Mui-error):before": { display: "none" },
- "&:hover": { bgcolor: bgColor },
+ "&:hover": { bgcolor: tokens.surface.inputBg },
"&.Mui-focused": {
- bgcolor: bgColor,
- borderColor: "#2f6df7",
- boxShadow: "0 0 0 2px rgba(47, 109, 247, 0.24)",
+ bgcolor: tokens.surface.inputBg,
+ borderColor: tokens.accent.main,
+ boxShadow: `0 0 0 2px ${tokens.accent.soft}`,
},
},
"& .MuiInputBase-input": {
padding: "0 !important",
- color: "#f4f7ff",
+ color: tokens.text.primary,
fontSize: "1.02rem",
lineHeight: 1.55,
},
@@ -44,7 +47,7 @@ export const pasteTextFieldSx = (
overflowY: "auto",
},
"& textarea::placeholder": {
- color: "rgba(230, 236, 255, 0.42)",
+ color: tokens.text.placeholder,
opacity: 1,
},
});
diff --git a/web/apps/paste/src/features/paste/hooks/usePasteColorMode.ts b/web/apps/paste/src/features/paste/hooks/usePasteColorMode.ts
new file mode 100644
index 0000000000..3e6aae8c10
--- /dev/null
+++ b/web/apps/paste/src/features/paste/hooks/usePasteColorMode.ts
@@ -0,0 +1,29 @@
+import { useColorScheme, useTheme } from "@mui/material/styles";
+import type { PasteResolvedMode } from "../theme/pasteThemeTokens";
+
+type PasteModePreference = "system" | "light" | "dark";
+
+interface UsePasteColorModeResult {
+ mode: PasteModePreference;
+ resolvedMode: PasteResolvedMode;
+ setMode: (mode: PasteModePreference) => void;
+}
+
+export const usePasteColorMode = (): UsePasteColorModeResult => {
+ const { mode, systemMode, setMode } = useColorScheme();
+ const theme = useTheme();
+
+ const normalizedMode: PasteModePreference = mode ?? "system";
+ const themeMode: PasteResolvedMode =
+ theme.palette.mode === "light" ? "light" : "dark";
+ const resolvedMode: PasteResolvedMode =
+ normalizedMode === "system" ? (systemMode ?? themeMode) : normalizedMode;
+
+ return {
+ mode: normalizedMode,
+ resolvedMode,
+ setMode: (nextMode) => {
+ setMode(nextMode);
+ },
+ };
+};
diff --git a/web/apps/paste/src/features/paste/theme/pasteThemeTokens.ts b/web/apps/paste/src/features/paste/theme/pasteThemeTokens.ts
new file mode 100644
index 0000000000..57bad13b24
--- /dev/null
+++ b/web/apps/paste/src/features/paste/theme/pasteThemeTokens.ts
@@ -0,0 +1,279 @@
+export type PasteResolvedMode = "light" | "dark";
+
+export interface PasteThemeTokens {
+ accent: {
+ main: string;
+ hover: string;
+ soft: string;
+ contrastText: string;
+ };
+ frame: {
+ outerBg: string;
+ innerBg: string;
+ innerBorder: string;
+ selectionBg: string;
+ selectionText: string;
+ headerIcon: string;
+ headerIconHoverBg: string;
+ modeIconBorder: string;
+ modeIconBg: string;
+ modeMenuBg: string;
+ modeMenuBorder: string;
+ logoTint: string;
+ };
+ text: {
+ primary: string;
+ secondary: string;
+ muted: string;
+ subtle: string;
+ placeholder: string;
+ counter: string;
+ counterHighlight: string;
+ footer: string;
+ footerDot: string;
+ copied: string;
+ dialogBody: string;
+ };
+ surface: {
+ inputBg: string;
+ inputBorder: string;
+ inputGradient: string;
+ inputShadow: string;
+ chipBg: string;
+ chipBorder: string;
+ chipText: string;
+ chipInsetShadow: string;
+ linkRowBg: string;
+ linkRowBorder: string;
+ linkRowInsetShadow: string;
+ floatingCardBg: string;
+ floatingCardBorder: string;
+ floatingCardShadow: string;
+ qrBackdropDesktop: string;
+ qrBackdropMobile: string;
+ dialogBackdrop: string;
+ dialogBg: string;
+ dialogBorder: string;
+ };
+ button: {
+ primaryBg: string;
+ primaryHoverBg: string;
+ primaryText: string;
+ primaryDisabledBg: string;
+ primaryDisabledText: string;
+ ghostBorder: string;
+ ghostText: string;
+ ghostHoverBorder: string;
+ ghostHoverBg: string;
+ qrToggleBorder: string;
+ qrToggleBg: string;
+ qrToggleActiveBg: string;
+ qrToggleHoverBg: string;
+ qrToggleActiveHoverBg: string;
+ qrToggleText: string;
+ scriptLink: string;
+ scriptLinkHover: string;
+ };
+ status: {
+ spinner: string;
+ loadingTitle: string;
+ loadingBody: string;
+ errorIcon: string;
+ errorBody: string;
+ deletedNote: string;
+ };
+ qr: {
+ paperBg: string;
+ module: string;
+ finder: string;
+ mobilePaperBg: string;
+ };
+}
+
+const darkTokens: PasteThemeTokens = {
+ accent: {
+ main: "#2f6df7",
+ hover: "#4c86ff",
+ soft: "rgba(47, 109, 247, 0.14)",
+ contrastText: "#f4f7ff",
+ },
+ frame: {
+ outerBg: "#2f6df7",
+ innerBg: "#0d1016",
+ innerBorder: "rgba(255, 255, 255, 0.04)",
+ selectionBg: "#2f6df7",
+ selectionText: "#ffffff",
+ headerIcon: "#f4f7ff",
+ headerIconHoverBg: "rgba(255, 255, 255, 0.12)",
+ modeIconBorder: "rgba(227, 236, 255, 0.25)",
+ modeIconBg: "rgba(255, 255, 255, 0.03)",
+ modeMenuBg: "rgba(20, 26, 40, 0.98)",
+ modeMenuBorder: "rgba(214, 226, 255, 0.16)",
+ logoTint: "#ffffff",
+ },
+ text: {
+ primary: "rgba(244, 247, 255, 0.95)",
+ secondary: "rgba(220, 229, 255, 0.82)",
+ muted: "rgba(186, 201, 232, 0.56)",
+ subtle: "rgba(182, 197, 229, 0.44)",
+ placeholder: "rgba(230, 236, 255, 0.42)",
+ counter: "rgba(234, 238, 255, 0.6)",
+ counterHighlight: "rgba(204, 224, 255, 0.96)",
+ footer: "rgba(220, 229, 255, 0.84)",
+ footerDot: "rgba(220, 229, 255, 0.58)",
+ copied: "rgba(182, 190, 208, 0.9)",
+ dialogBody: "rgba(220, 229, 255, 0.82)",
+ },
+ surface: {
+ inputBg: "rgba(39, 42, 52, 0.76)",
+ inputBorder: "rgba(213, 225, 255, 0.14)",
+ inputGradient:
+ "linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 58%, rgba(255, 255, 255, 0.015) 100%)",
+ inputShadow:
+ "0 12px 28px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.1)",
+ chipBg: "rgba(255, 255, 255, 0.045)",
+ chipBorder: "rgba(147, 155, 177, 0.24)",
+ chipText: "rgba(220, 229, 255, 0.55)",
+ chipInsetShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.05)",
+ linkRowBg: "rgba(255, 255, 255, 0.05)",
+ linkRowBorder: "rgba(214, 226, 255, 0.16)",
+ linkRowInsetShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.08)",
+ floatingCardBg: "rgba(9, 18, 48, 0.9)",
+ floatingCardBorder: "rgba(47, 109, 247, 0.44)",
+ floatingCardShadow: "0 16px 40px rgba(0, 0, 0, 0.42)",
+ qrBackdropDesktop: "rgba(5, 10, 24, 0.72)",
+ qrBackdropMobile: "rgba(5, 10, 24, 0.72)",
+ dialogBackdrop: "rgba(5, 10, 24, 0.74)",
+ dialogBg: "rgba(39, 42, 52, 0.76)",
+ dialogBorder: "rgba(213, 225, 255, 0.14)",
+ },
+ button: {
+ primaryBg: "#2f6df7",
+ primaryHoverBg: "#2f6df7",
+ primaryText: "rgba(231, 238, 252, 0.9)",
+ primaryDisabledBg: "rgba(255, 255, 255, 0.18)",
+ primaryDisabledText: "rgba(230, 236, 255, 0.44)",
+ ghostBorder: "rgba(214, 226, 255, 0.28)",
+ ghostText: "rgba(236, 242, 255, 0.95)",
+ ghostHoverBorder: "rgba(214, 226, 255, 0.44)",
+ ghostHoverBg: "rgba(255, 255, 255, 0.06)",
+ qrToggleBorder: "rgba(244, 247, 255, 0.35)",
+ qrToggleBg: "rgba(244, 247, 255, 0.12)",
+ qrToggleActiveBg: "rgba(244, 247, 255, 0.22)",
+ qrToggleHoverBg: "rgba(244, 247, 255, 0.18)",
+ qrToggleActiveHoverBg: "rgba(244, 247, 255, 0.28)",
+ qrToggleText: "#f4f7ff",
+ scriptLink: "#2f6df7",
+ scriptLinkHover: "#5d92ff",
+ },
+ status: {
+ spinner: "rgba(176, 198, 234, 0.76)",
+ loadingTitle: "rgba(201, 212, 236, 0.66)",
+ loadingBody: "rgba(188, 201, 230, 0.44)",
+ errorIcon: "rgba(180, 198, 232, 0.76)",
+ errorBody: "rgba(186, 201, 232, 0.46)",
+ deletedNote: "rgba(182, 197, 229, 0.44)",
+ },
+ qr: {
+ paperBg: "#fff",
+ module: "#2f6df7",
+ finder: "#1d3d9f",
+ mobilePaperBg: "#fff",
+ },
+};
+
+const lightTokens: PasteThemeTokens = {
+ accent: {
+ main: "#2f6df7",
+ hover: "#1f58e2",
+ soft: "rgba(47, 109, 247, 0.12)",
+ contrastText: "#f5f8ff",
+ },
+ frame: {
+ outerBg: "#2f6df7",
+ innerBg: "#f4f8ff",
+ innerBorder: "rgba(12, 37, 94, 0.1)",
+ selectionBg: "#2f6df7",
+ selectionText: "#ffffff",
+ headerIcon: "rgba(13, 35, 90, 0.86)",
+ headerIconHoverBg: "rgba(47, 109, 247, 0.16)",
+ modeIconBorder: "rgba(47, 109, 247, 0.22)",
+ modeIconBg: "rgba(47, 109, 247, 0.06)",
+ modeMenuBg: "rgba(255, 255, 255, 0.98)",
+ modeMenuBorder: "rgba(47, 109, 247, 0.2)",
+ logoTint: "#0d1016",
+ },
+ text: {
+ primary: "rgba(12, 35, 89, 0.96)",
+ secondary: "rgba(28, 57, 122, 0.82)",
+ muted: "rgba(38, 66, 132, 0.66)",
+ subtle: "rgba(52, 80, 148, 0.56)",
+ placeholder: "rgba(47, 76, 140, 0.48)",
+ counter: "rgba(35, 64, 129, 0.62)",
+ counterHighlight: "rgba(32, 92, 224, 0.96)",
+ footer: "#0d1016",
+ footerDot: "#0d1016",
+ copied: "rgba(37, 65, 126, 0.86)",
+ dialogBody: "rgba(37, 65, 129, 0.82)",
+ },
+ surface: {
+ inputBg: "rgba(255, 255, 255, 0.92)",
+ inputBorder: "rgba(47, 109, 247, 0.24)",
+ inputGradient:
+ "linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(242, 248, 255, 0.94) 58%, rgba(231, 241, 255, 0.9) 100%)",
+ inputShadow:
+ "0 10px 24px rgba(17, 51, 121, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.92)",
+ chipBg: "rgba(47, 109, 247, 0.07)",
+ chipBorder: "rgba(47, 109, 247, 0.24)",
+ chipText: "rgba(34, 61, 122, 0.72)",
+ chipInsetShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.8)",
+ linkRowBg: "rgba(255, 255, 255, 0.86)",
+ linkRowBorder: "rgba(47, 109, 247, 0.22)",
+ linkRowInsetShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.92)",
+ floatingCardBg: "rgba(245, 249, 255, 0.96)",
+ floatingCardBorder: "rgba(47, 109, 247, 0.3)",
+ floatingCardShadow: "0 14px 34px rgba(17, 49, 114, 0.18)",
+ qrBackdropDesktop: "rgba(18, 43, 94, 0.2)",
+ qrBackdropMobile: "rgba(18, 43, 94, 0.2)",
+ dialogBackdrop: "rgba(18, 43, 94, 0.2)",
+ dialogBg: "rgba(255, 255, 255, 0.94)",
+ dialogBorder: "rgba(47, 109, 247, 0.26)",
+ },
+ button: {
+ primaryBg: "#2f6df7",
+ primaryHoverBg: "#1f58e2",
+ primaryText: "#f4f8ff",
+ primaryDisabledBg: "rgba(47, 109, 247, 0.3)",
+ primaryDisabledText: "rgba(16, 43, 102, 0.5)",
+ ghostBorder: "rgba(47, 109, 247, 0.35)",
+ ghostText: "rgba(19, 48, 108, 0.92)",
+ ghostHoverBorder: "rgba(47, 109, 247, 0.5)",
+ ghostHoverBg: "rgba(47, 109, 247, 0.1)",
+ qrToggleBorder: "rgba(47, 109, 247, 0.3)",
+ qrToggleBg: "rgba(47, 109, 247, 0.12)",
+ qrToggleActiveBg: "rgba(47, 109, 247, 0.2)",
+ qrToggleHoverBg: "rgba(47, 109, 247, 0.18)",
+ qrToggleActiveHoverBg: "rgba(47, 109, 247, 0.28)",
+ qrToggleText: "#1f53c8",
+ scriptLink: "#1f58e2",
+ scriptLinkHover: "#1849bc",
+ },
+ status: {
+ spinner: "rgba(47, 109, 247, 0.74)",
+ loadingTitle: "rgba(26, 55, 118, 0.78)",
+ loadingBody: "rgba(52, 80, 142, 0.62)",
+ errorIcon: "rgba(47, 109, 247, 0.68)",
+ errorBody: "rgba(56, 84, 148, 0.72)",
+ deletedNote: "rgba(48, 77, 143, 0.6)",
+ },
+ qr: {
+ paperBg: "#fff",
+ module: "#2f6df7",
+ finder: "#1d3d9f",
+ mobilePaperBg: "#fff",
+ },
+};
+
+export const getPasteThemeTokens = (
+ mode: PasteResolvedMode,
+): PasteThemeTokens => (mode === "light" ? lightTokens : darkTokens);
diff --git a/web/apps/paste/src/pages/_app.tsx b/web/apps/paste/src/pages/_app.tsx
index 6483e818c5..b2863da154 100644
--- a/web/apps/paste/src/pages/_app.tsx
+++ b/web/apps/paste/src/pages/_app.tsx
@@ -11,11 +11,7 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {
useSetupLogs({ disableDiskLogs: true });
return (
- <ThemeProvider
- theme={shareTheme}
- defaultMode="system"
- storageManager={null}
- >
+ <ThemeProvider theme={shareTheme} defaultMode="system">
<CustomHead title="Ente Paste" />
<CssBaseline enableColorScheme />
<Component {...pageProps} />