I've been reading that there is no such thing in css like a parent selector: https://css-tricks.com/a-use-case-for-a-parent-selector/
Also mentioned here: Is there a CSS parent selector?
However, I don't want to use JS for this use-case and need to apply display:none
to the parent element (the child is not enough) - only if the data-path of the child ends with .png
:
What I've tried:
This works only for the child element (the parent is not even mentioned):
div[data-path$='.png'] {
display: none;
}
Same thing here as expected:
.nav-file div[data-path$='.png'] {
display: none;
}
I also tried the has-selector, but it didn't work either:
.nav-file:has(div[data-path$='.png']) {
display: none;
}
The style has to be applied to the .nav-file
-Object and not the child - any ideas?
Used Browser: Electron / Obsidian --> Chromium