posit-dev / positron

Positron, a next-generation data science IDE
Other
1.19k stars 32 forks source link

In dark mode, HTML rendering in the viewer pane is not legible for some content (text is too light) #3759

Open strengejacke opened 2 days ago

strengejacke commented 2 days ago

Code to reproduce:

library(sjPlot)
data("efc")
efc$c161sex <- as.factor(efc$c161sex)
efc$c172code <- as.factor(efc$c172code)

m1 <- lm(barthtot ~ c160age + c12hour + c161sex + c172code, data = efc)
m2 <- lm(neg_c_7 ~ c160age + c12hour + c161sex + e17age, data = efc)

tab_model(m1)

Problem: very light rendering of HTML text.

Desired: dark/black text color, like in RStudio or VSCode.

Platform: Windows 11

Note: sjPlot does not use certain packages to create the HTML table, but rather generates own HTML code. So it's not related to packages like gt or tinytable.

Output in Positron

image

Output in VSCode

image

Output in RStudio

image

juliasilge commented 2 days ago

Looks like this is a Windows-only problem, as I see this on Mac:

Screenshot 2024-06-30 at 3 58 49 PM

strengejacke commented 2 days ago

Maybe it's a dark theme issue? When I switch to light theme in Positron, I get

image

juliasilge commented 1 day ago

Ah yep, that's it! Thanks @strengejacke 👍

I do not see this problem with gt::gt(mtcars) but I do see this problem with knitr::kable(mtcars) |> kableExtra::kable_minimal().