Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix(email): emails read the same in Gmail's dark mode, one logo, clearer Auth copy (#2018)

Sid8f767c8053b4
diff --git a/.claude/rules/email-design.md b/.claude/rules/email-design.md
index a49fb6b88e..bc352d1ba1 100644
--- a/.claude/rules/email-design.md
+++ b/.claude/rules/email-design.md
@@ -34,8 +34,8 @@ are label/value details. Every piece below is load-bearing:
1. `<EmailThemeProvider preview={<Preview>…</Preview>} additionalHeadContent={<style>{notificationStyles}</style>}>` — the `Preview` is the inbox snippet; the `notificationStyles` are what make dark mode work.
2. `<Body className="my-auto mx-auto font-sans nf-body …themeClasses.body">`.
-3. `<Container className="my-[40px] mx-auto p-[36px] max-w-[560px] rounded-[16px] nf-card …" style={{ borderRadius: 16, borderStyle: "solid", borderWidth: 1 }}>` — 560px, radius 16, 1px border.
-4. `<Logo />` — the wordmark. Its `src` must be PUBLICLY reachable (the recipient's mail client fetches it): production/preview use `getAppUrl()`, anything else (a `crbn up` dev origin, localhost) falls back to `https://app.carbon.ms`.
+3. `<Container className="my-[40px] mx-auto p-[36px] max-w-[560px] rounded-[16px] nf-card …" style={{ borderRadius: 16, borderStyle: "solid", borderWidth: 1 }}>` — 560px, radius 16, 1px border. On a phone (≤ 600px) the card is the whole screen: `flatCardOnPhones` (`notificationStyles.ts`) drops its border, corners and outer margin and tightens the padding; an email with its own card class (`WeeklyReminderEmail`, `GetStartedEmail`) appends it to its styles.
+4. `<Logo />` — `carbon-email-mark.png` (ERP `public/`): the white mark on its own dark 80px tile, one image for every client and mode. Gmail's apps and classic Outlook recolour an email themselves and never run the dark CSS, but never recolour an image, so a light/dark logo swap is not used. Its `src` must be PUBLICLY reachable (the recipient's mail client fetches it): production/preview use `getAppUrl()`, anything else (a `crbn up` dev origin, localhost) falls back to `https://app.carbon.ms`. Never delete an image an email has referenced (`carbon-word-dark-outline.png`): mail already sent still loads it.
5. **Eyebrow** — `text-[11px] uppercase … nf-eyebrow`, `letterSpacing: "0.14em"`, `mt-[40px] mb-[10px]`. Names the category: "New notification", "Security", "Changelog".
6. **Heading** — `text-[26px] font-medium text-center tracking-tight … mb-[32px]`. The action or title, one line.
7. **Greeting** — `Hi {recipientName ?? "there"},` at `text-[15px] leading-[26px]`. Only when the recipient is a Carbon user with a name; a bare email address (a changelog subscriber) gets no greeting.
@@ -46,6 +46,8 @@ are label/value details. Every piece below is load-bearing:
## Rules that are not style
+- **No background images, and no page colour in light mode.** Gmail's iOS app ignores the dark-mode media queries and inverts the email's colours itself, but never a background image: a `linear-gradient` card stayed white while its text turned white. `.nf-body` has a colour only in dark mode, and `.nf-card` is a bordered box on the mail app's own background in light mode.
+- **The dark palette is Gmail's inversion of the light one.** `emailTheme.dark` (`components/Theme.tsx`) holds the colours Gmail's iOS app produced from the light palette (page `#131314`, callout `#242527`, button `#f3f3f3` on `#202124`, muted `#9fa7b6`), measured from a real screenshot, so Apple Mail and Outlook (which run the dark CSS) show the same email Gmail does. In dark mode the card is the page's colour, set off by its border. `notificationStyles` and `WeeklyReminderEmail` read the palette, never hex literals. Change a light colour and its dark twin changes in Gmail on its own: re-measure and update `emailTheme.dark` to match.
- **Dark mode is done by CLASS, not inline style.** Backgrounds go through `nf-*` classes so the `!important` media-query overrides in `notificationStyles` can flip them; an inline `background-color` beats them and renders a white card on a black Gmail. Text colors use `getEmailThemeClasses()` (`email-text`, `email-muted`, …). Off-black `#0e0e0e` and off-white `#fefefe`, never pure `#000`/`#fff` — pure values get auto-inverted by some clients.
- **No sample defaults on content props.** `NotificationEmail` deliberately gives `heading`/`message` no defaults: fabricated data must never reach a real recipient. Sample data lives in the preview fixture only. (Some older templates — `VerificationEmail` — still default their props; don't copy that, or their pre-card layout.)
- **Always send a `text` alternative** alongside `html` — the job builds it from the same content (see `entryEmailContent` in `packages/jobs/src/inngest/functions/tasks/changelog-dispatch.feed.ts`).
diff --git a/apps/erp/public/carbon-email-mark.png b/apps/erp/public/carbon-email-mark.png
new file mode 100644
index 0000000000..015563c587
Binary files /dev/null and b/apps/erp/public/carbon-email-mark.png differ
diff --git a/packages/documents/src/email/GetStartedEmail.tsx b/packages/documents/src/email/GetStartedEmail.tsx
index d4c3a17537..10af8d7077 100644
--- a/packages/documents/src/email/GetStartedEmail.tsx
+++ b/packages/documents/src/email/GetStartedEmail.tsx
@@ -14,6 +14,7 @@ import {
} from "react-email";
import { Button } from "./components/Button";
import { Logo } from "./components/Logo";
+import { flatCardOnPhones } from "./components/notificationStyles";
import {
EmailThemeProvider,
getEmailInlineStyles,
@@ -27,13 +28,7 @@ interface Props {
}
const getStartedStyles = `
- .gs-body {
- background-color: #f5f5f7;
- background-image: linear-gradient(180deg, #f5f5f7 0%, #ececef 100%);
- }
.gs-card {
- background-color: #ffffff;
- background-image: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
border-color: #e5e7eb !important;
}
.gs-divider {
@@ -52,6 +47,7 @@ const getStartedStyles = `
.gs-chevron {
color: #9ca3af !important;
}
+${flatCardOnPhones("gs-card")}
`;
interface ResourceProps {
@@ -191,10 +187,6 @@ export const GetStartedEmail = ({
>
<Body
className={`my-auto mx-auto font-sans gs-body ${themeClasses.body}`}
- style={{
- backgroundColor: "#f5f5f7",
- backgroundImage: "linear-gradient(180deg, #f5f5f7 0%, #ececef 100%)"
- }}
>
<Container
className={`my-[40px] mx-auto p-[36px] max-w-[560px] rounded-[16px] gs-card ${themeClasses.container}`}
@@ -203,8 +195,7 @@ export const GetStartedEmail = ({
borderWidth: 1,
borderColor: "#e5e7eb",
borderRadius: 16,
- backgroundColor: "#ffffff",
- backgroundImage: "linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%)"
+ backgroundColor: "#ffffff"
}}
>
<Logo />
diff --git a/packages/documents/src/email/WeeklyReminderEmail.tsx b/packages/documents/src/email/WeeklyReminderEmail.tsx
index 74e9db6aec..98d41fe79d 100644
--- a/packages/documents/src/email/WeeklyReminderEmail.tsx
+++ b/packages/documents/src/email/WeeklyReminderEmail.tsx
@@ -13,8 +13,10 @@ import {
} from "react-email";
import { Button } from "./components/Button";
import { Logo } from "./components/Logo";
+import { flatCardOnPhones } from "./components/notificationStyles";
import {
EmailThemeProvider,
+ emailTheme,
getEmailThemeClasses,
HeadStyle
} from "./components/Theme";
@@ -55,14 +57,10 @@ interface Props {
// Dark-mode-aware styles. Same approach as NotificationEmail: backgrounds via
// CSS classes (not inline styles) so `!important` overrides in dark-mode media
// queries can flip them. Outlook desktop renders light-mode only.
+const dark = emailTheme.dark;
+
const weeklyReminderStyles = `
- .wr-body {
- background-color: #f5f5f7;
- background-image: linear-gradient(180deg, #f5f5f7 0%, #ececef 100%);
- }
.wr-card {
- background-color: #ffffff;
- background-image: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
border-color: #e5e7eb;
}
.wr-eyebrow {
@@ -87,32 +85,30 @@ const weeklyReminderStyles = `
@media (prefers-color-scheme: dark) {
.wr-body {
- background-color: #0C0C0C !important;
- background-image: linear-gradient(180deg, #0C0C0C 0%, #161618 100%) !important;
+ background-color: ${dark.background} !important;
}
.wr-card {
- background-color: #161618 !important;
- background-image: linear-gradient(180deg, #161618 0%, #0F0F10 100%) !important;
- border-color: #1D1D1D !important;
+ background-color: ${dark.background} !important;
+ border-color: ${dark.border} !important;
}
.wr-eyebrow {
- color: #a1a1aa !important;
+ color: ${dark.muted} !important;
}
.wr-callout {
- background-color: #0F0F10 !important;
- border-color: #1D1D1D !important;
+ background-color: ${dark.panel} !important;
+ border-color: ${dark.border} !important;
}
.wr-row-divider {
- border-top-color: #1D1D1D !important;
+ border-top-color: ${dark.border} !important;
}
.wr-status {
- color: #a1a1aa !important;
+ color: ${dark.muted} !important;
}
.wr-status-overdue {
color: #f87171 !important;
}
.wr-fallback {
- color: #a1a1aa !important;
+ color: ${dark.muted} !important;
}
}
@@ -120,36 +116,34 @@ const weeklyReminderStyles = `
.gmail_dark .wr-body,
.gmail_dark_theme .wr-body,
[data-darkmode="true"] .wr-body {
- background-color: #0C0C0C !important;
- background-image: linear-gradient(180deg, #0C0C0C 0%, #161618 100%) !important;
+ background-color: ${dark.background} !important;
}
.gmail_dark .wr-card,
.gmail_dark_theme .wr-card,
[data-darkmode="true"] .wr-card {
- background-color: #161618 !important;
- background-image: linear-gradient(180deg, #161618 0%, #0F0F10 100%) !important;
- border-color: #1D1D1D !important;
+ background-color: ${dark.background} !important;
+ border-color: ${dark.border} !important;
}
.gmail_dark .wr-callout,
.gmail_dark_theme .wr-callout,
[data-darkmode="true"] .wr-callout {
- background-color: #0F0F10 !important;
- border-color: #1D1D1D !important;
+ background-color: ${dark.panel} !important;
+ border-color: ${dark.border} !important;
}
.gmail_dark .wr-row-divider,
.gmail_dark_theme .wr-row-divider,
[data-darkmode="true"] .wr-row-divider {
- border-top-color: #1D1D1D !important;
+ border-top-color: ${dark.border} !important;
}
.gmail_dark .wr-eyebrow,
.gmail_dark_theme .wr-eyebrow,
[data-darkmode="true"] .wr-eyebrow {
- color: #a1a1aa !important;
+ color: ${dark.muted} !important;
}
.gmail_dark .wr-status,
.gmail_dark_theme .wr-status,
[data-darkmode="true"] .wr-status {
- color: #a1a1aa !important;
+ color: ${dark.muted} !important;
}
.gmail_dark .wr-status-overdue,
.gmail_dark_theme .wr-status-overdue,
@@ -159,33 +153,34 @@ const weeklyReminderStyles = `
.gmail_dark .wr-fallback,
.gmail_dark_theme .wr-fallback,
[data-darkmode="true"] .wr-fallback {
- color: #a1a1aa !important;
+ color: ${dark.muted} !important;
}
/* Outlook web/mobile dark mode targeting */
[data-ogsb] .wr-body {
- background-color: #0C0C0C !important;
+ background-color: ${dark.background} !important;
}
[data-ogsb] .wr-card {
- background-color: #161618 !important;
- border-color: #1D1D1D !important;
+ background-color: ${dark.background} !important;
+ border-color: ${dark.border} !important;
}
[data-ogsb] .wr-callout {
- background-color: #0F0F10 !important;
- border-color: #1D1D1D !important;
+ background-color: ${dark.panel} !important;
+ border-color: ${dark.border} !important;
}
[data-ogsc] .wr-eyebrow {
- color: #a1a1aa !important;
+ color: ${dark.muted} !important;
}
[data-ogsc] .wr-status {
- color: #a1a1aa !important;
+ color: ${dark.muted} !important;
}
[data-ogsc] .wr-status-overdue {
color: #f87171 !important;
}
[data-ogsc] .wr-fallback {
- color: #a1a1aa !important;
+ color: ${dark.muted} !important;
}
+${flatCardOnPhones("wr-card")}
`;
// Content props get no sample defaults — fabricated data must never reach a
diff --git a/packages/documents/src/email/auth/AuthEmail.tsx b/packages/documents/src/email/auth/AuthEmail.tsx
index 4f0b44819d..9de90b3fa9 100644
--- a/packages/documents/src/email/auth/AuthEmail.tsx
+++ b/packages/documents/src/email/auth/AuthEmail.tsx
@@ -136,7 +136,7 @@ export function AuthEmail({
<Text
className={`text-[13px] leading-[20px] m-0 text-center break-all nf-fallback ${themeClasses.mutedText}`}
>
- Or open this link in your browser:{" "}
+ Button not working? Open this link in your browser:{" "}
<Link
href={action.href}
className={`${themeClasses.mutedText} underline nf-fallback`}
diff --git a/packages/documents/src/email/auth/index.tsx b/packages/documents/src/email/auth/index.tsx
index f55f939b78..7318a5ae01 100644
--- a/packages/documents/src/email/auth/index.tsx
+++ b/packages/documents/src/email/auth/index.tsx
@@ -11,21 +11,22 @@ const CONFIRMATION_URL = "{{ .ConfirmationURL }}";
/** The requesting app's /callback (emailRedirectTo), so the MES or academy
* signs in where it was asked, not on the ERP that hosts /magic-link. */
const REDIRECT_TO = "{{ .RedirectTo }}";
-const ONCE = "The code and the button are the same sign-in: use either, once.";
+const ONCE =
+ "Use the code or the button, not both: each email signs you in once.";
const IGNORE = "If you didn't ask for this, you can ignore this email.";
export const AuthMagicLinkEmail = () => (
<AuthEmail
preview={`Your Carbon sign-in code is ${AUTH_TOKEN}`}
eyebrow="Sign in"
- heading="Sign in to Carbon"
- intro="Enter this code on the sign-in screen, or use the button below."
+ heading="Your sign-in code"
+ intro="Enter this code on the Carbon sign-in screen, or sign in with the button below."
showCode
action={{
href: `${SITE_URL}/magic-link?token=${TOKEN_HASH}&redirect_to=${REDIRECT_TO}`,
- label: "Sign in"
+ label: "Sign in to Carbon"
}}
- footnote={`${ONCE} ${IGNORE}`}
+ footnote={`${ONCE} If you didn't try to sign in, you can ignore this email.`}
/>
);
@@ -34,11 +35,12 @@ export const AuthInviteEmail = () => (
preview="You have been invited to Carbon"
eyebrow="Invitation"
heading="You've been invited to Carbon"
- intro="You've been invited to create an account on Carbon."
+ intro="Accept the invite to set up your Carbon account."
action={{
href: `${SITE_URL}/confirm-invite?token=${TOKEN_HASH}`,
- label: "Accept the invite"
+ label: "Accept invite"
}}
+ footnote="If you weren't expecting this invite, you can ignore this email."
/>
);
@@ -46,12 +48,12 @@ export const AuthInviteEmail = () => (
// accepts its code: type "email" covers confirmation tokens.
export const AuthConfirmationEmail = () => (
<AuthEmail
- preview={`Your Carbon sign-in code is ${AUTH_TOKEN}`}
- eyebrow="Sign in"
+ preview={`Your Carbon confirmation code is ${AUTH_TOKEN}`}
+ eyebrow="Confirm email"
heading="Confirm your email"
- intro="Enter this code on the sign-in screen, or use the button below to confirm your email address."
+ intro="Enter this code on the Carbon sign-in screen, or confirm with the button below."
showCode
- action={{ href: CONFIRMATION_URL, label: "Confirm your email" }}
+ action={{ href: CONFIRMATION_URL, label: "Confirm email" }}
footnote={IGNORE}
/>
);
@@ -61,9 +63,9 @@ export const AuthRecoveryEmail = () => (
preview="Reset your Carbon password"
eyebrow="Security"
heading="Reset your password"
- intro="Use the button below to reset your password."
- action={{ href: CONFIRMATION_URL, label: "Reset your password" }}
- footnote={IGNORE}
+ intro="Choose a new password for your Carbon account."
+ action={{ href: CONFIRMATION_URL, label: "Reset password" }}
+ footnote="If you didn't ask to reset your password, you can ignore this email. Your password stays the same."
/>
);
@@ -72,9 +74,9 @@ export const AuthEmailChangeEmail = () => (
preview="Confirm your new email for Carbon"
eyebrow="Security"
heading="Confirm your new email"
- intro="Confirm the change of your Carbon email from {{ .Email }} to {{ .NewEmail }}."
- action={{ href: CONFIRMATION_URL, label: "Confirm the new email" }}
- footnote={IGNORE}
+ intro="Your Carbon email is changing from {{ .Email }} to {{ .NewEmail }}. Confirm to finish the change."
+ action={{ href: CONFIRMATION_URL, label: "Confirm new email" }}
+ footnote="If you didn't ask for this change, ignore this email and your email stays the same."
/>
);
diff --git a/packages/documents/src/email/components/Logo.tsx b/packages/documents/src/email/components/Logo.tsx
index 5f5d3904b2..276aa96484 100644
--- a/packages/documents/src/email/components/Logo.tsx
+++ b/packages/documents/src/email/components/Logo.tsx
@@ -3,41 +3,27 @@
// including ports, remain AGPLv3; serving them over a network requires releasing their source.
import { getAppUrl } from "@carbon/env";
-import type React from "react";
import { Img, Section } from "react-email";
const baseUrl = getAppUrl();
-// Two wordmarks. The outlined dark one reads on either background, so it
-// is what a client shows when it inverts colours on its own (Gmail, classic
-// Outlook). A client that runs the theme's dark CSS swaps it for the white
-// one: `.dark-mode-hide` hides the first, `.dark-mode-show` reveals the
-// second, which stays hidden everywhere else. Classic Outlook can still paint
-// an image inside a hidden div, so a non-MSO conditional keeps it out there.
+// One image for every client and mode: the white mark on its own dark tile.
+// Gmail's apps and classic Outlook recolour an email in dark mode themselves
+// and never run the theme's dark CSS, so a light/dark logo swap reaches only
+// some clients. They never recolour an image, so a tile with its background
+// baked in reads the same on a white card and on a dark one.
+// carbon-word-dark-outline.png, the old fallback, stays in public/: emails
+// already sent still load it.
export function Logo() {
return (
<Section className="mt-[32px]">
<Img
- src={`${baseUrl}/carbon-word-dark-outline.png`}
- width="auto"
- height="45"
+ src={`${baseUrl}/carbon-email-mark.png`}
+ width="80"
+ height="80"
alt="Carbon"
- className="mb-4 mx-auto block dark-mode-hide"
+ className="mb-4 mx-auto block"
/>
- <span dangerouslySetInnerHTML={{ __html: "<!--[if !mso]><!-->" }} />
- <div
- className="dark-mode-show"
- style={{ display: "none", msoHide: "all" } as React.CSSProperties}
- >
- <Img
- src={`${baseUrl}/carbon-word-dark.png`}
- width="auto"
- height="44"
- alt="Carbon"
- className="mb-4 mx-auto block"
- />
- </div>
- <span dangerouslySetInnerHTML={{ __html: "<!--<![endif]-->" }} />
</Section>
);
}
diff --git a/packages/documents/src/email/components/Theme.tsx b/packages/documents/src/email/components/Theme.tsx
index f0a0b5dfd1..472f5dcbc6 100644
--- a/packages/documents/src/email/components/Theme.tsx
+++ b/packages/documents/src/email/components/Theme.tsx
@@ -21,13 +21,17 @@ export const emailTheme = {
accent: "#0e0e0e",
secondary: "#9ca3af"
},
+ // What Gmail's apps make of the light palette when they recolour an email
+ // for dark mode (measured), so a client that runs this theme's dark CSS
+ // (Apple Mail, Outlook) shows the same email as one that inverts it.
dark: {
- background: "#0C0C0C",
+ background: "#131314",
foreground: "#fefefe", // Slightly off-white to prevent auto-inversion
- muted: "#a1a1aa",
- border: "#1D1D1D",
- panel: "#161618",
- accent: "#fefefe",
+ muted: "#9fa7b6",
+ border: "#2e2f33",
+ panel: "#242527",
+ accent: "#f3f3f3",
+ accentForeground: "#202124",
secondary: "#6b7280"
}
} as const;
@@ -77,7 +81,7 @@ export const getEmailDarkModeCSS = () => {
.email-button {
background-color: ${emailTheme.dark.accent} !important;
border-color: ${emailTheme.dark.accent} !important;
- color: ${emailTheme.dark.background} !important;
+ color: ${emailTheme.dark.accentForeground} !important;
}
/* Image swapping for dark mode */
@@ -127,7 +131,7 @@ export const getEmailDarkModeCSS = () => {
[data-darkmode="true"] .email-button {
background-color: ${emailTheme.dark.accent} !important;
border-color: ${emailTheme.dark.accent} !important;
- color: ${emailTheme.dark.background} !important;
+ color: ${emailTheme.dark.accentForeground} !important;
}
}
@@ -178,7 +182,7 @@ export const getEmailDarkModeCSS = () => {
display: block !important;
}
[data-ogsc] .email-button {
- color: ${emailTheme.dark.background} !important;
+ color: ${emailTheme.dark.accentForeground} !important;
}
[data-ogsb] .email-button {
background-color: ${emailTheme.dark.accent} !important;
@@ -250,7 +254,7 @@ export function EmailThemeProvider({
{/* Additional Gmail dark mode hints */}
<meta
name="theme-color"
- content="#0C0C0C"
+ content={emailTheme.dark.background}
media="(prefers-color-scheme: dark)"
/>
<meta
@@ -258,7 +262,10 @@ export function EmailThemeProvider({
content="#ffffff"
media="(prefers-color-scheme: light)"
/>
- <meta name="msapplication-navbutton-color" content="#0C0C0C" />
+ <meta
+ name="msapplication-navbutton-color"
+ content={emailTheme.dark.background}
+ />
{/* Dark mode styles */}
<HeadStyle css={getEmailDarkModeCSS()} />
diff --git a/packages/documents/src/email/components/notificationStyles.ts b/packages/documents/src/email/components/notificationStyles.ts
index e960673d9f..dafa98354b 100644
--- a/packages/documents/src/email/components/notificationStyles.ts
+++ b/packages/documents/src/email/components/notificationStyles.ts
@@ -2,6 +2,31 @@
// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+import { emailTheme } from "./Theme";
+
+const dark = emailTheme.dark;
+
+/**
+ * On a phone the card is the whole screen: no border, corners or outer
+ * margin, and less padding. A rounded border hugging the screen's edges
+ * reads as a mistake.
+ */
+export function flatCardOnPhones(card: string) {
+ return `
+ @media only screen and (max-width: 600px) {
+ .${card} {
+ border-width: 0 !important;
+ border-radius: 0 !important;
+ margin-top: 0 !important;
+ margin-bottom: 0 !important;
+ }
+ .${card} > tbody > tr > td {
+ padding: 32px 20px !important;
+ }
+ }
+`;
+}
+
// Dark-mode-aware styles shared by every card-style email (notifications and
// the standalone lifecycle emails). Backgrounds are intentionally set via CSS
// classes (not inline styles) so `!important` overrides in dark-mode media
@@ -9,15 +34,16 @@
// loses to `!important`. Most modern clients (Apple Mail, iOS Mail, Gmail
// web/iOS, Outlook web/mobile) honor this; Outlook desktop renders light-mode
// only, matching the rest of the system.
+//
+// Flat colours only, and no page colour in light mode. Gmail's iOS app ignores
+// these media queries and inverts the email's colours itself, but it never
+// inverts a background image: a gradient kept the card white while the text
+// on it turned white. With no page colour the light card sits on the mail
+// app's own background, and the inverted card matches the dark app around it.
+// The dark colours (`emailTheme.dark`) are what Gmail's inversion produces,
+// so the dark card is the page's colour too, set off by its border.
export const notificationStyles = `
- .nf-body,
- .nf-body > table > tbody > tr > td {
- background-color: #f5f5f7;
- background-image: linear-gradient(180deg, #f5f5f7 0%, #ececef 100%);
- }
.nf-card {
- background-color: #ffffff;
- background-image: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
border-color: #e5e7eb;
}
.nf-divider {
@@ -40,29 +66,27 @@ export const notificationStyles = `
@media (prefers-color-scheme: dark) {
.nf-body,
.nf-body > table > tbody > tr > td {
- background-color: #0C0C0C !important;
- background-image: linear-gradient(180deg, #0C0C0C 0%, #161618 100%) !important;
+ background-color: ${dark.background} !important;
}
.nf-card {
- background-color: #161618 !important;
- background-image: linear-gradient(180deg, #161618 0%, #0F0F10 100%) !important;
- border-color: #1D1D1D !important;
+ background-color: ${dark.background} !important;
+ border-color: ${dark.border} !important;
}
.nf-divider {
- border-color: #1D1D1D !important;
+ border-color: ${dark.border} !important;
}
.nf-eyebrow {
- color: #a1a1aa !important;
+ color: ${dark.muted} !important;
}
.nf-callout {
- background-color: #0F0F10 !important;
- border-color: #1D1D1D !important;
+ background-color: ${dark.panel} !important;
+ border-color: ${dark.border} !important;
}
.nf-callout-accent {
background-color: #fefefe !important;
}
.nf-fallback {
- color: #a1a1aa !important;
+ color: ${dark.muted} !important;
}
}
@@ -73,31 +97,29 @@ export const notificationStyles = `
.gmail_dark_theme .nf-body > table > tbody > tr > td,
[data-darkmode="true"] .nf-body,
[data-darkmode="true"] .nf-body > table > tbody > tr > td {
- background-color: #0C0C0C !important;
- background-image: linear-gradient(180deg, #0C0C0C 0%, #161618 100%) !important;
+ background-color: ${dark.background} !important;
}
.gmail_dark .nf-card,
.gmail_dark_theme .nf-card,
[data-darkmode="true"] .nf-card {
- background-color: #161618 !important;
- background-image: linear-gradient(180deg, #161618 0%, #0F0F10 100%) !important;
- border-color: #1D1D1D !important;
+ background-color: ${dark.background} !important;
+ border-color: ${dark.border} !important;
}
.gmail_dark .nf-divider,
.gmail_dark_theme .nf-divider,
[data-darkmode="true"] .nf-divider {
- border-color: #1D1D1D !important;
+ border-color: ${dark.border} !important;
}
.gmail_dark .nf-eyebrow,
.gmail_dark_theme .nf-eyebrow,
[data-darkmode="true"] .nf-eyebrow {
- color: #a1a1aa !important;
+ color: ${dark.muted} !important;
}
.gmail_dark .nf-callout,
.gmail_dark_theme .nf-callout,
[data-darkmode="true"] .nf-callout {
- background-color: #0F0F10 !important;
- border-color: #1D1D1D !important;
+ background-color: ${dark.panel} !important;
+ border-color: ${dark.border} !important;
}
.gmail_dark .nf-callout-accent,
.gmail_dark_theme .nf-callout-accent,
@@ -107,29 +129,29 @@ export const notificationStyles = `
.gmail_dark .nf-fallback,
.gmail_dark_theme .nf-fallback,
[data-darkmode="true"] .nf-fallback {
- color: #a1a1aa !important;
+ color: ${dark.muted} !important;
}
/* Outlook web/mobile dark mode targeting */
[data-ogsb] .nf-body,
[data-ogsb] .nf-body > table > tbody > tr > td {
- background-color: #0C0C0C !important;
+ background-color: ${dark.background} !important;
}
[data-ogsb] .nf-card {
- background-color: #161618 !important;
- border-color: #1D1D1D !important;
+ background-color: ${dark.background} !important;
+ border-color: ${dark.border} !important;
}
[data-ogsb] .nf-callout {
- background-color: #0F0F10 !important;
- border-color: #1D1D1D !important;
+ background-color: ${dark.panel} !important;
+ border-color: ${dark.border} !important;
}
[data-ogsc] .nf-eyebrow {
- color: #a1a1aa !important;
+ color: ${dark.muted} !important;
}
[data-ogsc] .nf-callout-accent {
background-color: #fefefe !important;
}
[data-ogsc] .nf-fallback {
- color: #a1a1aa !important;
+ color: ${dark.muted} !important;
}
-`;
+${flatCardOnPhones("nf-card")}`;