simov / markdown-viewer

Markdown Viewer / Browser Extension
MIT License
1.05k stars 133 forks source link

linked css not working, only working if copied #107

Closed DoctorSubtilis closed 1 year ago

DoctorSubtilis commented 4 years ago

So far (3.7) I was able to link from my home to extension folder a css. Now, with 3.8, a linked css is working no more: it works only if copied in themes folder: why? Thank you

simov commented 4 years ago

You mean symbolic link on your file system? Browser extensions doesn't have control over how files are read from your local system, it's the browser itself that allows and controls that.

You sure that's not because of a browser update for example?

DoctorSubtilis commented 4 years ago

Yes, symlinks.
No, I'm not sure if it depends from a browser update: what browser's settings should I check?

simov commented 4 years ago

I don't know, but this is most likely a breaking change in Chrome after update. There is no way for a browser extension to check for symlinks, at least that I know of.

DoctorSubtilis commented 4 years ago

ok, thank you

DoctorSubtilis commented 4 years ago

Today I found a workaround: put within the css (in Chomium extension folder) a link toward my css: @import url(http://localhost/path-to-my-file/myfile.css

another small question

So it works, but I noticed that the left toc div (in chromium window) isn't affected by css (even I use #_toc)

Thanks

simov commented 4 years ago

I'm probably using some really heavy css rules there, like !important on a # selector, check out the .css files in the repo, you should be able to style it with the correct selector + using !important.

DoctorSubtilis commented 4 years ago

Thank you. Already done, but unsuccessfully (as in attached image): #_toc-left #_toc {background-image: linear-gradient(to right, #d9d9d9,#e6e6e6 80%) !important; color: white;} Screenshot_20200403_102834
Probably this is due to tha fact that ""#_toc" division (the left one), unlike "#_html" div (at right side), doesn't have the class class="markdown-theme" (applied from Chromium: customizable?)

simov commented 4 years ago

Your selector isn't correct ._toc-left is a class, although you probably don't need this, check out the TOC styles here https://github.com/simov/markdown-viewer/blob/master/content/index.css#L56-L92

DoctorSubtilis commented 4 years ago

Thank you. I tried with:
#_toc {background: transparent !important; background-image: linear-gradient(to right, #d9d9d9,#e6e6e6 80%) !important; color: white !important;} but unsuccessfully. Using "inspect", as I said, I see that to "#_toc", unlike "#_html" div, as in attached image, isn't applied the class "markdown-theme": this is the problem, I guess. I don't know if this is your "guilt", so to say, or Chromium... Screenshot_20200403_105309

DoctorSubtilis commented 4 years ago

Sorry: the problem was the Chromium cache!
Now it works!