Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import colors from local file #328

Open
vKnmnn opened this issue Jan 26, 2018 · 5 comments
Open

import colors from local file #328

vKnmnn opened this issue Jan 26, 2018 · 5 comments

Comments

@vKnmnn
Copy link

vKnmnn commented Jan 26, 2018

As a user of pywal, i have a .css file containing the values color0 to color15, background holding the path to a local image file.

Now I'd like to include these colors into Stylish.

Since i do not know a thing about CSS, how should i go about this?
color: var(--color0); gives a warning and stylish falls back to white

20:17 $ cat .cache/wal/colors.css 
/* CSS variables
   Generated by 'wal' */
:root {
    --wallpaper: url("/path/to/wallpaper/wallpaper.jpg");

    /* Special */
    --background: #1b1e16;
    --foreground: #d8e6e8;
    --cursor: #d8e6e8;

    /* Colors */
    --color0: #1b1e16;
    --color1: #8BABB5;
    --color2: #C0BDAE;
    --color3: #99BBC4;
    --color4: #A2BEC5;
    --color5: #AFCFD6;
    --color6: #B1D1D6;
    --color7: #d8e6e8;
    --color8: #97a1a2;
    --color9: #8BABB5;
    --color10: #C0BDAE;
    --color11: #99BBC4;
    --color12: #A2BEC5;
    --color13: #AFCFD6;
    --color14: #B1D1D6;
    --color15: #d8e6e8;
}
@oatmealine
Copy link

oatmealine commented Mar 17, 2018

Only keep the needed part:

/* Background */
--wallpaper: url("/path/to/wallpaper/wallpaper.jpg");

/* Special */
--background: #1b1e16;
--foreground: #d8e6e8;
--cursor: #d8e6e8;

/* Colors */
--color0: #1b1e16;
--color1: #8BABB5;
--color2: #C0BDAE;
--color3: #99BBC4;
--color4: #A2BEC5;
--color5: #AFCFD6;
--color6: #B1D1D6;
--color7: #d8e6e8;
--color8: #97a1a2;
--color9: #8BABB5;
--color10: #C0BDAE;
--color11: #99BBC4;
--color12: #A2BEC5;
--color13: #AFCFD6;
--color14: #B1D1D6;
--color15: #d8e6e8;

and paste it into the file at the top. Also: try not to use any local files, as Stylish only supports a single .css file as a style. I'm not sure about @import with URLs, but the wiki said not to use it.

@vKnmnn
Copy link
Author

vKnmnn commented Mar 20, 2018

If i shouldn't use local files, then how do i get my pywal colors loaded into stylish?
The deal about pywal is, that the colors are dynamic, they are created on the fly, to match a given image, so it's not possible to hardcode them directly into the file.

@Cimaje
Copy link

Cimaje commented Jul 4, 2018

Has there been an answer to this anywhere? I have ran into the same problem

@vKnmnn
Copy link
Author

vKnmnn commented Jul 13, 2018

So, modern browsers block the use of file:// links as described here.
There is a method described in that link how to circumvent this. (for firefox 1.5!)
without having tried it, it seems, like we would have to make an exception for every site for which we would like to import local files. Or disabling that security feature altogether.

oh and by the way, folks, don't use stylish. it sends a copy of your whole internet traffic to their servers. use stylus instead.

@niksingh710
Copy link

is there any possibility with pywalfox?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants