obsidian-dataview icon indicating copy to clipboard operation
obsidian-dataview copied to clipboard

Provide an option not to render hidden inline fields monospace

Open deqyra opened this issue 1 year ago • 2 comments

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. ♥

deqyra avatar Mar 04 '23 00:03 deqyra

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.

xDovos avatar Mar 07 '23 00:03 xDovos

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

joshkehn avatar Feb 13 '24 20:02 joshkehn