Inline dataview weird spacing

Hello, I have a file called test.md with the following contetn:

---
test-properties: |-
  - This
  - is a
  - test
  - :)
---

Now, if I go on a new file and I type: =[[test]].test-properties, then on reading view I get desired result:

But on live preview:

How can I solve this? Thank’s

Try this snippet (Here’s a guide to use CSS Snippets):

.markdown-rendered ul > li{
  line-height: 0.2em!important; //Adjust the number as needed
}

Before:

After

Alternative:

.dataview ul > li{
  line-height: 0.2em!important;
}

Thank’s, is it possible to inherit the value from the current theme?

Don’t know. We can try. Which theme are you using?

Edit: I mean, the current theme you are using isn’t applying the desired spacing in the dataview list, which means that to “inherit” the spacing you want we need to edit your theme, or mimic the "list-spacing"value into the snippet I provided before.

The css snippets does not works anyway

If you are using the minimal theme you can play with the style settings plugin:
Style settings > Minimal > List & Tasks > List Item Spacing.

Alternatively you can open Style Settings click on import and paste this (Play with the number to get the desired spacing):

{
  "minimal-style@@list-spacing": 0.125
}

And for the snippet maybe there’s some padding involved, try this:

.dataview ul > li{
  color: red;
  line-height: 0.2em!important;
  padding: 0!important;
}

I added the color: red so you can notice that the CSS is being applied.

This is live-preview:


Notice the white space is not added by me, indeed on this note what I typed was:

Text
`=[[test]].test-properties`
Text

And on reading mode:

Try this and adjust the line-height as you wish, remember that your theme settings can generate a different output.

.markdown-reading-view .dataview ul{
  color: red; /* Delete when done. */
  line-height: 1.2em!important;
}

.markdown-source-view.mod-cm6:is(.is-live-preview) .dataview ul{
  color: yellow; /* Delete when done. */
  line-height: 0.6em!important;
}

.markdown-source-view.mod-cm6:is(.is-live-preview) img.cm-widgetBuffer{
  display: none !important; /* Hides buffer-spacing above and below */
}

Source:

Live preview:

Reading mode:

If that works for you, please remember to choose the answer as a solution to guide others in the future. Thanks.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.