For the first I realized that [data-path$="XXX"] can be used as CSS selector. Is this the standard CSS selector? I could not find such information on the web…
Seems it works only in the Obsidian. Tested in the web browser and does not seem to work. Anyway, it doesn’t matter whether it works outside Obsidian. Thanks for information.
My first thought is that standard CSS selector is not able to select HTML element by its content. So I posted this feature request.
However, as ariehen answered, a sort of Obsidian-specific CSS selector works.
But in my understading, you are referring to a totally different context. I am not saying about navigation on published site. But I am saying about File pane in Obsidian desktop/mobile app
I just wanted to elaborate a little on whether this is a standard CSS-selector, or not, and when it’s available. If you look at the Obsidian CSS guide, and navigate your way to a file with an extension, you’ll see something like the following:
Here you can see that the data-path is an added attribute to the .nav-file-title element, thusly allowing for attribute CSS selectors to be applied to it. See MDN or W3Schools for documentation on these.
Basically you can now target any of the attributes in an html element, and you can match against start, end or within the attribute in various combination. A really nifty addition to CSS allowing for some fancy CSS to be applied.
This addition is done by Obsidian, so you kind of have to look it up for each element where you might benefit from it, but if you want to target some element you’ll most likely look it up using Developers Tools (as suggested in the guide above), and then you’ll see if there any extra attributes for you to play around with.