@emailens/engine 0.8.2 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -41,6 +41,9 @@ declare function structuralWarnings(warnings: CSSWarning[]): CSSWarning[];
41
41
  * - Some invert colors (Gmail Android)
42
42
  * - Some use prefers-color-scheme media query (Apple Mail)
43
43
  * - Some do partial inversion (Outlook.com)
44
+ *
45
+ * Last verified: 2026-03-04
46
+ * Sources: Litmus dark mode guide, caniemail.com, Parcel dark mode guide
44
47
  */
45
48
  declare function simulateDarkMode(html: string, clientId: string): {
46
49
  html: string;
package/dist/index.d.ts CHANGED
@@ -41,6 +41,9 @@ declare function structuralWarnings(warnings: CSSWarning[]): CSSWarning[];
41
41
  * - Some invert colors (Gmail Android)
42
42
  * - Some use prefers-color-scheme media query (Apple Mail)
43
43
  * - Some do partial inversion (Outlook.com)
44
+ *
45
+ * Last verified: 2026-03-04
46
+ * Sources: Litmus dark mode guide, caniemail.com, Parcel dark mode guide
44
47
  */
45
48
  declare function simulateDarkMode(html: string, clientId: string): {
46
49
  html: string;
package/dist/index.js CHANGED
@@ -5509,7 +5509,7 @@ var GMAIL_CLIP_THRESHOLD = 102 * 1024;
5509
5509
  var GMAIL_CLIP_WARNING_THRESHOLD = 90 * 1024;
5510
5510
  var CLIENT_DISPLAY_LIMITS = [
5511
5511
  { client: "Gmail (Web)", subjectLimit: 70, preheaderLimit: 90 },
5512
- { client: "Gmail (Mobile)", subjectLimit: 40, preheaderLimit: 90 },
5512
+ { client: "Gmail (Mobile)", subjectLimit: 40, preheaderLimit: 45 },
5513
5513
  { client: "Outlook (Web)", subjectLimit: 60, preheaderLimit: 90 },
5514
5514
  { client: "Outlook (Desktop)", subjectLimit: 55, preheaderLimit: 35 },
5515
5515
  { client: "Apple Mail (macOS)", subjectLimit: 78, preheaderLimit: 140 },
@@ -6610,6 +6610,15 @@ function simulateDarkMode(html, clientId) {
6610
6610
  break;
6611
6611
  case "outlook-web":
6612
6612
  applyColorInversion($, "partial");
6613
+ if (!html.includes("prefers-color-scheme")) {
6614
+ warnings.push({
6615
+ severity: "info",
6616
+ client: clientId,
6617
+ property: "dark-mode",
6618
+ message: "Outlook.com applies partial color inversion in dark mode.",
6619
+ suggestion: "Use [data-ogsc] or [data-ogsb] CSS attribute selectors to override Outlook.com's dark mode color changes."
6620
+ });
6621
+ }
6613
6622
  break;
6614
6623
  case "outlook-windows":
6615
6624
  applyColorInversion($, "full");
@@ -6619,19 +6628,18 @@ function simulateDarkMode(html, clientId) {
6619
6628
  client: clientId,
6620
6629
  property: "dark-mode",
6621
6630
  message: "Outlook Windows applies full color inversion in dark mode. Colors may shift unexpectedly.",
6622
- suggestion: "Test with dark mode enabled. Use [data-ogsc] or [data-ogsb] overrides to control Outlook dark mode rendering."
6631
+ suggestion: "Test with dark mode enabled. The Word rendering engine offers limited control over dark mode color shifts."
6623
6632
  });
6624
6633
  }
6625
6634
  break;
6626
6635
  case "apple-mail-macos":
6627
6636
  case "apple-mail-ios":
6628
6637
  if (!html.includes("prefers-color-scheme")) {
6629
- applyColorInversion($, "partial");
6630
6638
  warnings.push({
6631
6639
  severity: "info",
6632
6640
  client: clientId,
6633
6641
  property: "dark-mode",
6634
- message: "Apple Mail supports @media (prefers-color-scheme: dark). Consider adding dark mode styles.",
6642
+ message: "Apple Mail supports @media (prefers-color-scheme: dark). Without it, email content renders unchanged in dark mode.",
6635
6643
  suggestion: "Add a @media (prefers-color-scheme: dark) block with inverted colors for the best dark mode experience."
6636
6644
  });
6637
6645
  }