Skip to content

Dark mode media query breaks table readability in light-themed Quarto documents #649

@andrerecio

Description

@andrerecio

The media query overrides --tt-text-color to #e0e0e0 regardless of the host document's actual background color. Since Quarto light themes like flatly keep a white background even when the OS is in dark mode, the result is light grey text on white — effectively invisible.

Minimal Quarto document:

---
title: "Test"
format:
  html:
    theme: flatly
---
```{r}
library(modelsummary)
mod <- lm(mpg ~ wt + hp, data = mtcars)
modelsummary(mod)
```

Steps to reproduce:

  1. Set macOS to dark mode (System Settings → Appearance → Dark)
  2. Render the document with quarto render
  3. Open the resulting HTML in Safari or Chrome
  4. The table text is unreadable (light grey on white background)

Expected behavior

The table should respect the host document's color scheme, not the OS preference, unless the host document itself opts into dark mode — for example via Quarto's dual theme configuration:

---
title: "Test"
format:
  html:
    theme: 
      light: flatly
      dark: darkly
---
---
title: "Test"
format:
  html:
    theme: 
        light: flatly
        dark: darkly
---

Screenshots

Image Image

Environment

  • tinytable 0.16.0
  • modelsummary 2.6.0
  • Quarto 1.9.36
  • R 4.5.3
  • macOS 26.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions