callumhackett / obsidian_polka_theme

A spotty theme (light and dark) for Obsidian
MIT License
12 stars 1 forks source link

Code dataview snippets use dark theme color in light mode #5

Closed danieltomasz closed 1 year ago

danieltomasz commented 1 year ago

I used this code in light mode


# 📝 Notes

- <% tp.file.cursor() %>

---

### Notes created today

```dataview

List FROM "" WHERE file.cday = date("<%tp.date.now("YYYY-MM-DD")%>") SORT file.ctime asc

Notes last touched today


List FROM "" WHERE file.mday = date("<%tp.date.now("YYYY-MM-DD")%>") SORT file.mtime asc


this is how it looks in light mode (in dark mode is ok)

<img width="782" alt="image" src="https://user-images.githubusercontent.com/7980381/219907687-276b34a4-7042-47fe-a276-d00ebd8ea707.png">
callumhackett commented 1 year ago

Thanks again for the heads up. This looks similar to the previous issue with the file tree #3 but is different. This seems to be a problem with Dataview and/or Obsidian, as these error blocks are formatted to use the same background color as code blocks (Polka has dark code blocks in both light and dark mode), so they should have been setup to use the code block text color but this wasn't done, so the text defaults to the main body font color (black in this case).

Anyway, it's straightforward to patch, so I'll include a fix in an update tomorrow that will also introduce some Style Settings support. :)

danieltomasz commented 1 year ago

The code - <% tp.file.cursor() %> coming from Templater; this behouvior is visible only when the query doesn't work (here in the chunk I use templater placeholder instead of real data; I will wait for the update :)

callumhackett commented 1 year ago

This is now addressed in v1.3.0. As these are error code blocks, I haven't reformatted them too heavily to make them pretty but hopefully you won't be seeing errors too often. They are at least legible now. ;)