Popup preview of links, Embeds & Canvas: Narrowing to heading/block should follow cssclass of target note

I first drafted this as a bug report, but silly me added the title last and then saw in “Similar Topics” that there was already a bug report for embeds in the bug graveyard (I only searched active bug reports prior) Embedding heading / block reference: CSSClass in YAML ignored
Unfortunately it seems that this is not seen as a bug given the comment by WhiteNoise, therefore I’ve created this feature request instead.
I will add my bug report draft below for further understanding.

Use case or problem

Narrowing a note to a heading or block via an Embed or through the Canvas does not apply the cssclass settings of the note.

Proposed solution

People put a lot of effort into making their notes look exactly how they want them to look, the specificity of cssclasses are a huge part of that, therefore I think that narrowing a note should still keep the cssclass settings intact.

Current workaround (optional)

None I’m aware of.




Steps to reproduce

  1. Create a CSS Snippet with a cssclass and add it to the Sandbox Vault

  2. Open Sandbox Vault and activate the snippet under Appearance

  3. Create a note with the cssclass in the frontmatter and the heading and block needed for testing
    Test Note

  4. Create a Canvas and add the note to it.

  5. Narrow the note to heading/block
    Canvas test

Expected result

I would expect that the CSS applied to the note via a cssclass is also visible if narrowed to heading or block.

Actual result

The css applied to a note via a cssclass are not visible if note is narrowed to heading/block in Canvas & Embeds.

Environment

  • Operating system:

Windows 10
Obsidian v.1.1.16
Sandbox Vault


5 Likes

It would be great if the css class stylings that carry over to the popup hover window from page links could be extended to also cover headings and block references. I love the window, and use it all the time as a memory jogger for terms, formulas etc., but only on a block level, so it would be a really nice addition imo.

3 Likes

Adding support for this feature request, i think it would be quite helpful in many situations, especially for users who create highly modular sets of cssclasses to style their notes in various ways. Having this feature would help with uniformity of appearance and improve recognition of target file context at a glance.

3 Likes

+1
My use case is for customizing the preview window from a specific note by using cssclasses, but it currently works only if I link to the note rather than its headers.

I made a post asking for help with that, and was directed to this post.

renamed and consolidated

+1, for what it’s worth. I don’t understand the omission of ‘cssclasses property’ from the design and agree with the OP.