blacksmithgu / obsidian-dataview

A data index and query language over Markdown files, for https://obsidian.md/.
https://blacksmithgu.github.io/obsidian-dataview/
MIT License
6.94k stars 411 forks source link

Provide an option not to render hidden inline fields monospace #1827

Open deqyra opened 1 year ago

deqyra commented 1 year ago

Is your feature request related to a problem? Please describe. When I use any type of inline fields, their contents are rendered with a monospace font, pretty much like inline code samples in regular Markdown. While this makes sense for regular inline fields, it does less so for inline fields with a hidden key.
image
In my case where the data is short paragraphs, the purpose of hiding the key is kind of defeated by having the text awkwardly stand out as shown in the screen shot.

Describe the solution you'd like Instead of the above, I'd like said hidden inline fields to be rendered normally, or at least have an option to tell Dataview to do so.

Describe alternatives you've considered There is a workaround to that, although not a very comfortable one: one can stuff the data into the front matter header, and then inline-query it in the body. It is then rendered using a regular font, as shown below:
image

Thank you for making Dataview. ♥

xDovos commented 1 year ago

you could use a css snipped to change it back to normal looking text. but i can't help with that because i don't know any css.

joshkehn commented 8 months ago

I was running into this as well and used this snippet:

.dataview.inline-field .dataview.inline-field-standalone-value {
    font-family: var(--font-text);
    padding-left: 0px;
    padding-right: 0px;
    background-color: var(--background-primary);
}

I also restyled the visible inline fields:

.dataview.inline-field .dataview.inline-field-key {
    padding-left: 0px;
    padding-right: 0px;
    font-family: var(--font-text);
    background-color: var(--background-primary);
}

.dataview.inline-field .dataview.inline-field-value {
    padding-left: 0.8ex;
    padding-right: 0px;
    text-decoration: underline;
    background-color: var(--background-primary);
}
Field Before After
Visible Screenshot 2024-02-13 at 15 27 24 Screenshot 2024-02-13 at 15 27 11
Hidden Screenshot 2024-02-13 at 15 28 21 Screenshot 2024-02-13 at 15 28 12