Apple Books ePub CSS dark mode background color on element

For the most part, @media (prefers-color-scheme: dark) is working for Apple Books. However, I appear to be unable to set background-color and have it work in Grey and Night. Sepia shows just fine.

The two items I need a background-color on are pre and forcing a white background onto svg images.

I've used:

pre {
    background-color: #212427;
}

img[src ^= "data:image/svg"] {
    background-color: white;
    padding: 10px;

  }

within the media (prefers-color-scheme: dark) but it doesn't seem to matter for Apple Books specifically (other readers relying on this are working). I've also tried setting !important but no dice. The backgrounds work fine in light mode and Sepia.


What am I missing?



Posted on May 2, 2023 7:26 AM

Reply

Similar questions

There are no replies.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Apple Books ePub CSS dark mode background color on element

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.