I'm not so sure why the codes do not work in Joplin, but it works fine when testing it based on a web page environment. Please let me know if there is anything I've missed.
Details
Win11Pro | Joplin v2.9.12
My purpose is to add custom fonts to my theming plugin as the built-in font for it.
Below showing how I do it:
In my case, I'm using the method below to load all CSS codes of my theme:
Not sure if it is exactly the same but I remember asking something similar a long time ago for a plugin theme. I believe it was to do with the actual joplin installation path.
The above paths were found based on the plugin testing environment, which means entering the jpl file path into tools > options > plugins > show advanced settings > development plugins. I don't know if the path might be different when installing the plugin as normal, but I think it might not a good idea to use the external sources directly in the userstyle.css and userchrom.css. However, as @Daeraxa suggested, using the "absolute path" is totally fine if only for personal use.
I can't remember which plugin I was looking at now to get ideas, probably the macOS theme, but I think I came to the conclusion that essentially the .css file would have to be created programmatically after it gets things like the resource dir from the API.
Ya, so whatever I tried, if I keep using the loadChromeCssFile(); and loadNoteCssFile(); to load the CSS, the problem won't change.
Umm... I realized that, and I think I'm not familiar with this way, so I can only give up for now. If Joplin created one more loadSrc() method for this case, it would be saving me. Anyway, thx D!