# Code block looks wrong in e-mail w/ Thunderbird default dark colors

**URL:** https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689
**Category:** Support
**Created:** [May 25, 2020, 7:57pm UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689 "2020-05-25T19:57:30Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![532910](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/532910/32/172812_2.png) [@532910](https://meta.discourse.org/u/532910)
#### Post date: [May 25, 2020, 7:57pm UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689/1 "2020-05-25T19:57:30Z")

</div>

1. wrong colors
2. no scroll

> **[Support for Mikrotik RB3011UiAS-RM?](https://forum.openwrt.org/t/support-for-mikrotik-rb3011uias-rm/4064/500?u=532910)**
>
> My upstream patches are at https://lore.kernel.org/linux-arm-msm/cover.1589824955.git.noodles@earth.li/T/#t (pretty much the same as yours but varied for mainline) and I'm using https://the.earth.li/~noodles/rb3011-mainline.diff on top of...

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/2/a227bc6fdd22000ed9718b6571e39d79145d8f3d.png)

 ![image](https://global.discourse-cdn.com/meta/original/3X/b/f/bf1e622f6c6c4abfbe7ae38342aba3d2417af9fc.png)

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [May 25, 2020, 8:52pm UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689/2 "2020-05-25T20:52:22Z")

</div>

I know we’ve had a few email format related fixes in the last few days, first suggestion would be to update the site.

---

<div class="post-metadata">

### Author: ![532910](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/532910/32/172812_2.png) [@532910](https://meta.discourse.org/u/532910)
#### Post date: [May 25, 2020, 10:29pm UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689/3 "2020-05-25T22:29:26Z")

</div>

I don’t maintain OpenWrt’s discourse but can ask the administrator if these fixes were released, weren’t they?

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [May 25, 2020, 10:52pm UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689/4 "2020-05-25T22:52:37Z")

</div>

Yep, reach out to the admin. They should be able to run an upgrade.

---

<div class="post-metadata">

### Author: ![tmomas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tmomas/32/109144_2.png) [@tmomas](https://meta.discourse.org/u/tmomas)
#### Post date: [May 26, 2020, 5:34am UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689/5 "2020-05-26T05:34:57Z")

</div>

We are already on 2.5.0.beta4 with the OpenWrt forum.  
To which discourse version should we update?

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [May 26, 2020, 9:53am UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689/6 "2020-05-26T09:53:11Z")

</div>

You may be updating within the same version, just ensure you are running the lastest code.

---

<div class="post-metadata">

### Author: ![thess](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thess/32/121467_2.png) [@thess](https://meta.discourse.org/u/thess)
#### Post date: [May 26, 2020, 11:17pm UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689/7 "2020-05-26T23:17:48Z")

</div>

@532910 Site updated to 2.5.0-beta5. That’s the best I can do now.

/ted (OpenWrt - sysadmin)

---

<div class="post-metadata">

### Author: ![532910](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/532910/32/172812_2.png) [@532910](https://meta.discourse.org/u/532910)
#### Post date: [May 27, 2020, 10:24am UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689/8 "2020-05-27T10:24:13Z")

</div>

2.5.0-beta5 has the same issue

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [May 27, 2020, 9:48pm UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689/10 "2020-05-27T21:48:23Z")

</div>

I believe this is quite a complex email specific HTML and CSS issue which depends on the email client, so it’s only indirectly a Discourse issue, I know @simon looked at this very recently as well using the Litmus email testing system.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [May 27, 2020, 10:28pm UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689/11 "2020-05-27T22:28:25Z")

</div>

> [@532910](#):
>
> 2.5.0-beta5 has the same issue

I’m testing this with the same version.

When I send test emails with codeblocks to Litmus, I’m not seeing the problems that are in the initial post in this topic. For long blocks of code, the full code block is displayed. I _am_ seeing a small issue with the background color of codeblocks not extending the full width of the code on the Thunderbird email client, but the code is still legible:

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/9/c9096344fc0a9d0be4f6a9af8a20eeeaee417565.png)

What email client are you using to read the emails? Have any customizations been made to the email template or CSS that can be edited from the site’s Admin / Customize / Email Style section?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [May 28, 2020, 3:58pm UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689/13 "2020-05-28T15:58:33Z")

</div>

> [@simon](#):
>
> When I send test emails with codeblocks to Litmus, I’m not seeing the problems that are in the initial post in this topic.

Looks like OP is using dark mode? Maybe that’s the issue?

---

<div class="post-metadata">

### Author: ![532910](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/532910/32/172812_2.png) [@532910](https://meta.discourse.org/u/532910)
#### Post date: [May 29, 2020, 4:09am UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689/14 "2020-05-29T04:09:38Z")

</div>

This is Thunderbird 68.8.1 from debian sid, I believe it uses gecko and the content should look similar to firefox 76.0.1 where it looks fine.

The style for this html violates that both fg and bg colors should be defined together and relies on common default: black\_fg/white\_bg:

```plaintext
<div style="padding-top:5px;"><pre style="word-wrap: break-word; max-width: 694px;"><code style="display: block; background-color: #f1f1ff; padding: 5px;; background-color: #f1f1ff; padding: 2px 5px;">

```

(BTW, Why it’s so sloppy? `padding` and `background-color` are repeated twice.)

Moreover looks like it ignores my discourse-user preferences, tb style and tries to display this in light mode.

---

<div class="post-metadata">

### Author: ![532910](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/532910/32/172812_2.png) [@532910](https://meta.discourse.org/u/532910)
#### Post date: [May 29, 2020, 4:11am UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689/15 "2020-05-29T04:11:46Z")

</div>

Just noticed, that mails from Discourse Meta looks pretty good, but they are white. (While messages from 2.5.0-beta5 that I’ve just installed locally looks bad.)

Could someone reply here with a long-line code block to how it will look on my side, please.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [May 29, 2020, 11:37am UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689/16 "2020-05-29T11:37:58Z")

</div>

Here’s a long line block 😉

```plaintext
<div style="padding-top:5px;"><pre style="word-wrap: break-word; max-width: 694px;"><code style="display: block; background-color: #f1f1ff; padding: 5px;; background-color: #f1f1ff; padding: 2px 5px;">
```

---

<div class="post-metadata">

### Author: ![532910](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/532910/32/172812_2.png) [@532910](https://meta.discourse.org/u/532910)
#### Post date: [May 29, 2020, 12:25pm UTC](https://meta.discourse.org/t/code-block-looks-wrong-in-e-mail-w-thunderbird-default-dark-colors/152689/17 "2020-05-29T12:25:59Z")

</div>

Looks good, except theme and scrolling:

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/c/6c73a57d8b254a4b3e3f3676bf6744b2d5cf8223.png)
