SlRvb / Obsidian--ITS-Theme

Theme designed with readability and customizability in mind. Change it easily to your liking with the Style Settings plugin installed.
https://publish.obsidian.md/slrvb-docs/ITS+Theme/ITS+Theme
GNU General Public License v2.0
523 stars 112 forks source link

[Bug] `[cards|dataview]` hides inner card #179

Closed scottTomaszewski closed 1 year ago

scottTomaszewski commented 1 year ago

Describe the bug

Obsidian Callout inside a [!cards|dataview] doesnt render properly

Expected behavior expected each card to have a callout in it that is usable

To Reproduce

Steps to reproduce the behavior:

> [!cards|dataview 3]
> ```dataviewjs
> dv.table(["foo"], 
>   ["1", "2"].map(n => [dv.span(`
> > [!note]- callout title
> > callout content
> `)])
> )
> ```

Screenshots

image

OS

Where does the bug occur?

Obsidian Version: 1.1.9

Additional context

The callout works when its not in a cards callout:

```dataviewjs
dv.table(["foo"], 
    ["1", "2"].map(n => [dv.span(`
> [!note]- callout title
> callout content
`)])
)
```
scottTomaszewski commented 1 year ago

Update: I was playing with the css, it looks like the display: none that is here (https://github.com/SlRvb/Obsidian--ITS-Theme/blob/main/Snippets/S%20-%20Callouts.css#L688) is the source of the hiding. While I think this is necessary for the outer card, it might be a bit aggressive? I have no idea what im doing, but I changed to the following and it rendered properly.

.callout[data-callout~=cards] > .callout-title {
  display: none;
}

(Using the CSS child combinator > here) Not sure what the side effects are, maybe you have some insight?

SlRvb commented 1 year ago

It's mostly old css styling and that usually cards callout isn't meant to hold sub callouts. I'll see to being more specific with callout CSS with ITS v1