diff --git a/content/integrations/email/client-previews.mdx b/content/integrations/email/client-previews.mdx index d956b0956..5d81f84b4 100644 --- a/content/integrations/email/client-previews.mdx +++ b/content/integrations/email/client-previews.mdx @@ -7,16 +7,9 @@ layout: integrations - Email client previews are currently only available on our{" "} - - Enterprise plan - - . - + <>Email client previews are available on all paid plans (Starter and up). } /> diff --git a/content/integrations/email/layouts.mdx b/content/integrations/email/layouts.mdx index afb294386..0b787a19c 100644 --- a/content/integrations/email/layouts.mdx +++ b/content/integrations/email/layouts.mdx @@ -105,10 +105,16 @@ Inject account- and environment-level variables into your layout with the `vars. Branding properties set in account settings are available under `vars.branding.*`: -- `vars.branding.logo_url` -- `vars.branding.icon_url` -- `vars.branding.primary_color` -- `vars.branding.primary_color_contrast` +| Variable | Description | +| ------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `vars.branding.logo_url` | URL of the logo image for your brand. | +| `vars.branding.icon_url` | URL of the icon image for your brand. | +| `vars.branding.dark_logo_url` | URL of the logo image for dark mode. Defaults to `logo_url` if not set. | +| `vars.branding.dark_icon_url` | URL of the icon image for dark mode. Defaults to `icon_url` if not set. | +| `vars.branding.primary_color` | Primary brand color (hex). Defaults to `#000000`. | +| `vars.branding.primary_color_contrast` | Contrast color for text on primary color backgrounds (hex). Defaults to `#FFFFFF`. | +| `vars.branding.dark_primary_color` | Primary brand color for dark mode (hex). Defaults to `#FFFFFF`. | +| `vars.branding.dark_primary_color_contrast` | Contrast color for text on dark mode primary color backgrounds (hex). Defaults to `#000000`. | With [per-tenant branding](/multi-tenancy/per-tenant-branding), Knock resolves these properties against the `tenant_id` on the workflow run, falling back to account-level branding if the tenant has none set. @@ -223,6 +229,54 @@ The ` + + +``` + +For swapping logos and icons in dark mode, see [Swapping logos and icons in dark mode](/integrations/email/layouts#swapping-logos-and-icons-in-dark-mode) in the email layouts documentation. + +## Styling buttons in MJML layouts + +The Knock default MJML layout styles buttons using your branding colors, with automatic dark mode support. This applies to both legacy `mj-button` components and visual editor buttons. + +#### How branding colors are applied + +- **Solid buttons** use `primary_color` as the background and `primary_color_contrast` as the text color. +- **Outline buttons** use a transparent background with `primary_color` as the text and border color. +- **Dark mode** uses `dark_primary_color` (defaults to `#FFFFFF`) and `dark_primary_color_contrast` (defaults to `#000000`). + +```mjml title="MJML branding-aware button styling" + + /* Light mode button styles */ .block-button--solid { background-color: {{ + vars.branding.primary_color | default: "#000000" }}; color: {{ + vars.branding.primary_color_contrast | default: "#FFFFFF" }}; } + .block-button--outline { background-color: transparent; color: {{ + vars.branding.primary_color | default: "#000000" }}; border-color: {{ + vars.branding.primary_color | default: "#000000" }}; } /* Dark mode overrides + */ @media (prefers-color-scheme: dark) { .block-button--solid { + background-color: {{ vars.branding.dark_primary_color | default: "#FFFFFF" }} + !important; color: {{ vars.branding.dark_primary_color_contrast | default: + "#000000" }} !important; } .block-button--outline { background-color: + transparent !important; color: {{ vars.branding.dark_primary_color | default: + "#FFFFFF" }} !important; border-color: {{ vars.branding.dark_primary_color | + default: "#FFFFFF" }} !important; } } + +``` + +#### Why dark mode uses `!important` overrides + +The visual editor renders button colors as static inline styles that don't change between light and dark mode. To ensure buttons remain readable on dark backgrounds, the layout uses `!important` in dark mode to override these inline styles. This means per-button colors from the visual editor are respected in light mode, while dark mode enforces branding-aware colors for readability. + +For more details, see [Styling buttons](/integrations/email/layouts#styling-buttons) in the email layouts documentation. + ## Limitations - **MJML layouts require the `` root tag.** Layouts set to MJML mode must be valid MJML documents. diff --git a/content/multi-tenancy/overview.mdx b/content/multi-tenancy/overview.mdx index 26f20b3ff..4356fea40 100644 --- a/content/multi-tenancy/overview.mdx +++ b/content/multi-tenancy/overview.mdx @@ -45,13 +45,17 @@ Use the [tenant API methods](/api-reference/tenants) to create or update a tenan ### `TenantSettings` -| Property | Description | -| --------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `branding.primary_color` | A hex value for the primary color | -| `branding.primary_color_contrast` | A hex value for the contrasting color to use with the primary color | -| `branding.logo_url` | A fully qualified URL for an image to use as the logo of this tenant | -| `branding.icon_url` | A fully qualified URL for an image to use as the icon of this tenant | -| `preference_set` | A complete `PreferenceSet` to use as a default for all recipients with workflows triggered for this tenant | +| Property | Description | +| -------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `branding.logo_url` | A fully qualified URL for an image to use as the logo of this tenant | +| `branding.icon_url` | A fully qualified URL for an image to use as the icon of this tenant | +| `branding.dark_logo_url` | A fully qualified URL for the logo to use in dark mode. Defaults to `logo_url` if not set | +| `branding.dark_icon_url` | A fully qualified URL for the icon to use in dark mode. Defaults to `icon_url` if not set | +| `branding.primary_color` | A hex value for the primary color. Defaults to `#000000` | +| `branding.primary_color_contrast` | A hex value for the contrasting color to use with the primary color. Defaults to `#FFFFFF` | +| `branding.dark_primary_color` | A hex value for the primary color in dark mode. Defaults to `#FFFFFF` | +| `branding.dark_primary_color_contrast` | A hex value for the contrasting color in dark mode. Defaults to `#000000` | +| `preference_set` | A complete `PreferenceSet` to use as a default for all recipients with workflows triggered for this tenant |