Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

CSS Make Stylus use local files?

KittenKatja

Well-Known Coder
Hey there,

I come back with another problem.
I am using Stylus for a while now and restructured and changed the code for the Youtube CSS and added a background picture.
Here's the problem, my current internet connection is very slow and I'd like to load the picture faster without slowing down youtube performance, but I can't find a way for Stylus to use local files like put it on my desktop, access it from its own extension folder or anything.
I have looked around for a Stylus Forum, but I could only find a changelog website with a comment section.
The following URLs don't work:
url(file:///C:/Users/<redacted>/Desktop/<picture>)
url(file:///C:/Users/<redacted>/AppData/Local/Google/Chrome/User%20Data/Default/Extensions/clngdbkpkpeebahjckkjfobafhncgmne/katja/<picture>)
url(file:///C:/Users/<redacted>/AppData/Local/Google/Chrome/User%20Data/Default/Extensions/clngdbkpkpeebahjckkjfobafhncgmne/1.5.21_0/katja/<picture>)
url(chrome-extension://clngdbkpkpeebahjckkjfobafhncgmne/katja/<picture>)
url(chrome-extension://clngdbkpkpeebahjckkjfobafhncgmne/assets/<picture>)
url(chrome-extension://clngdbkpkpeebahjckkjfobafhncgmne/assets/images/<picture>)
Weirdly enough the last is also used by Stylus to access another extensions' gif picture to replace the scrubber, I put the same picture into that folder and it still doesn't work.
 
Hi, I made an account just for this!

Happened to stumble upon your post as I was searching for a solution for the same problem.
I guess you have already figured it out as I'm replying almost 2 years later,
but I thought my input would help anyone who happens to find themselves here like I did.
Nevertheless, my solution was converting the image to base64 and having it inline in the css.
Imo quite hacky but it works! :)

Guide here:
Data URIs | CSS-Tricks

Oh, and for some reason it just straight up doesn't work with UserCSS themes.
With non UC themes it still throws an error for me but functions normally otherwise.

I hope this was helpful to anyone reading! <3
 
Back
Top Bottom