Preview in Dark mode shows light background

I thought the Preview will smart enough to change background color based on current theme. But both light and dark show as light preview. I tested Markdown.

Preview steps display HTML content. They, in and of themselves, do not have an intelligence about the theme. I would not want to try to make them force a theme because many use them for very specific output, like to do preview that match their websites, so it might interfere with those uses to try to override values to match the theme.

The preview that ships in the Markdown keyboard (also available here), uses scripting to check for theme and change the HTML/CSS output to better match the current mode. Try using this one, as I think it does what you are looking for.

I was using the keyboard shortcuts of ‘preview’, and I tested again by installing the script then keyboard shortcuts preview. Result attached.

Btw, I imported the preview-dark keyboard shortcut from drafts 4, and it worked.

In other words it still doesn’t work, right? I tried the same thing. I even edited the htmlpreview and the script that runs before it that checks for dark or whatever. Still just white background, black text :frowning:

Working for me…

Yeah I tried messing with it. Are you using that Light/Dark Markdown thing that’s an included Action on new installs? Or did you make your own Action using the HTML Preview Action Step thing (I haven’t tried that yet myself)?

Just what Greg provided above.

Is it possible you are in “Light” theme mode, but just selected a dark theme as your “Light” mode theme option? This preview is not actually hooked into theme values, just checks with mode you are in to make the change.

Nice suggestion, but alas, no: when my “Dark” theme is selected, I still don’t get a dark HTML preview. Is there a list of exposed JavaScript core things for Drafts (I know 1Writer has docs for those things)?