From 640d312734963cb36edfb3b4e1721a71ec5f6339 Mon Sep 17 00:00:00 2001 From: Vincent Date: Fri, 3 May 2024 15:50:31 +0200 Subject: [PATCH] Add/use dark mode versions of email images I'm not 100% happy with email authors needing to not forget to add the component, but I suppose in practice people will start by copy-pasting an existing template anyway. I also bumped the size of the question mark icon in the footer to render at 300 DPI at 34x34px. --- .../question-mark-circle-purple-dark-mode.png | Bin 0 -> 3558 bytes .../icons/question-mark-circle-purple.png | Bin 1032 -> 3884 bytes src/emails/templates/EmailFooter.tsx | 9 +++++++ src/emails/templates/EmailHeader.tsx | 9 +++++++ src/emails/templates/EmailStyles.tsx | 25 ++++++++++++++++++ .../monthlyActivity/MonthlyActivityEmail.tsx | 2 ++ 6 files changed, 45 insertions(+) create mode 100644 public/images/email/icons/question-mark-circle-purple-dark-mode.png create mode 100644 src/emails/templates/EmailStyles.tsx diff --git a/public/images/email/icons/question-mark-circle-purple-dark-mode.png b/public/images/email/icons/question-mark-circle-purple-dark-mode.png new file mode 100644 index 0000000000000000000000000000000000000000..3696d44d68e272735851c06834ada55a672fad72 GIT binary patch literal 3558 zcmV#u0 z!qy6BI-}WX8(S;MrqP4}cM7IXOIkCb7=wWZti(tw$5qXb+C>h50w%$3!IBO7wc2<3 z$3DgSwR`WreY-fH8IP^^&b{}%uilS)&pr2ARFw~lu2yDCh6O6rI8dWd1Iz|a1J3mR z2KWFt27G{WM1(^Kuei{g8D;;{_5AOLbO}f~1?)*MW4Matj&QlcWx!_vDY9AxUPjq1 z!gCto-(&R*7VoVcr57-Pv$u*`S6G4aO@xn>v_0iG!egRrf9n%GdHwZdO4(e=1nfvq zRS{*Sz&haLC27RWYofFso52HDu4cFt4FoP=Pl6dERjfj|3ph8>%Kh^jQCcHI+_$ia zfgmdmRKV_LzNW$tfC~bvG*}KR)Yry&B&Z4l5wLqB7pOx!@YUj7Dm@B2R9Riu$eYF1 zRkVPqB!2=tK(^cQyMuCE;5$ni`PX8q@h#x4b}DBM(S~wIF%INmP_z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45^p5BiS%h-b5dtD9Sz6L)`6m+km1sVDvVqc#z-04H$8_CDu^TzBp4TI<8jR z$YUB}K>=gu4kmD;@;A39UEu`vD)`w#O!3Q)P{}#6J)MjqJu6*hz$ofO^YS z=H=or!kxo|Toj~uP{NJ4cePVFbAX$?JqA8ml19wDiqKL$z*fH>2@_@6OMmZ17OKOa zX*T|56a6iQeqe_<{Ns{!JWGI!Z>FQH{~19?f~txtz9jG^gv)@7DgHI$0xv4;R^i$7 z0MAVqIW84t6>u^=ZJa%tVS$@nuXmwBjRUhaI}Dr2$!W&-fj)r~svJQ$gz}1n=ylTU gU$nk_slSu?e>hv8G{-?Je*gdg07*qoM6N<$f;2d}zW@LL literal 0 HcmV?d00001 diff --git a/public/images/email/icons/question-mark-circle-purple.png b/public/images/email/icons/question-mark-circle-purple.png index 93e235db9e8090a4a809cc853ee3c4a269e8d2f6..5247f3790629a9f97eb7c9dbe67ac9582dc3b523 100644 GIT binary patch literal 3884 zcmV+{57Y38P)u#M-6-Dvhx#ymD`u(`~+;c9(%=o;RU(zt$%(W_rc^)&*1JOJH(*gV$ zfOGA?0pJe+J_Yax5ROCg0VeUjAZx!I=I*YKH~;VFbP1qrIxrlFPO%KRgcw&5Pz|6Q z0QpqQ0Nw$(ok{G-=c&Km6}x}XzqNW~+<`=mqN?=hB9?L)K;H$pD5D*M`T;x*DW8~q zwEy|X`Ee_wy=BUQ)nzO52dtbLFt1^tEF+z$IYfl@eR&0&4<6hwl!*?~?!a&$It7Nc zika>JFf*;nz4I{>trr$O($U*=DxHec>cFZ%-M2v40HRrGQ<_Eyh)c%pUGbJD)21^W z4y-6^m?aX4jR3CmZ&DUueumh%t)sW8$FC~i4h)yp{Vg+XMsnEkCj|9_5$TLKKkiG5 zR|n3SvpTQn^x%B}ZuMh;1A|D8|A6Fpupk3{FasM0@(b?r`jPSEz{`Wn&reY9b^w3j zrPDD60Q(qt4Zzz1IAD=H&>bs1#(cLNBS(#*BGgl2u$U{E=K;7BB(4Pb%Y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uuvotyQ_lrUzly6Dog9HHwk-OIS<%5RCH36t*^J~M0j?zn9uNU0G{u{007udQrw!2 z5ZGi?meyWKZ2VNaq}7IieYxPTrDfBJ5#|RYL6fix?zcS|An^J#B6s84M;`jrWm``y z3e}xw2L{&QkK2gq(qq9~v?unkvN{TIx$(||K;ybR^-P7_kTU?<(cm6`~ zlpz!4ew_!TdlTAV{dGjV;d9*fSj8b?UfmIIbu6)PLs}!do$==FxhVV!7`H>C$~;>T z5GT-&ip<1U(&;=PgBx+rnX@{tXz?P)QB6@YInbl3X{K zdh`d)#!+=Z;?Cyzl3bjtlRF~Dex+7t``Pbf`}x@cxYo5s3t^#%WlM0LM65s%RNZ#PgZ~9$-+8`>7VM<~ z7=b`;xMv?KX||~#v<+(vU_DXY00uRSVci1DR}~?I`7i{VygO8Us2kIEt0+m6_1h~$_m!Rf1_e58UfEz&_HrKEV^k~d%d1)O^kJS96RVWA7+fkDV% zUz@<9!SA4?HX|XxO}4vU#TOQz7glagt(HCG*qF19daFqN_rV|$V!iK`O(om8p-yO`j$QMUS6w0-G$gpRJ?ZAIpYjy(!!Hx)zx#xtY* zumB^ZoKrwQ7D3=ZiV)e7=CppL-PEZ#TmDJwm+yeVqhSvnd$zpEB&?*`(Un12_oz$c zHBa7U3|0x-8tEDg5yi;k_#1I)m>qJy*B@I}jboWA1rN5Oq}2f_sk;S?9-!9$L}UI? zedFf|(CyAITAyYni;a-yR$Iq!Toc5= zdj^s0cIsf9(+DN5@S#_|0idL|RDT$O;VF?B!~_!qNkMyUxpDT5@ { + { + { + return ( + + {` + .dark-mode-only { + display: none; + } + @media (prefers-color-scheme: dark) { + .dark-mode-only { + display: unset; + } + .light-mode-only { + display: none; + } + } + `} + + ); +}; diff --git a/src/emails/templates/monthlyActivity/MonthlyActivityEmail.tsx b/src/emails/templates/monthlyActivity/MonthlyActivityEmail.tsx index d82a5bc03..2628c9df2 100644 --- a/src/emails/templates/monthlyActivity/MonthlyActivityEmail.tsx +++ b/src/emails/templates/monthlyActivity/MonthlyActivityEmail.tsx @@ -8,6 +8,7 @@ import { SanitizedSubscriberRow } from "../../../app/functions/server/sanitize"; import { ExtendedReactLocalization } from "../../../app/functions/l10n"; import { EmailFooter } from "../EmailFooter"; import { EmailHeader } from "../EmailHeader"; +import { EmailStyles } from "../EmailStyles"; export type Props = { subscriber: SanitizedSubscriberRow; @@ -38,6 +39,7 @@ const MonthlyActivityPlusWithManualRemovalsEmail = (props: Props) => { return ( + {l10n.getString("email-monthly-plus-manual-preview")}