alphapapa / solarized-everything-css

A collection of Solarized user-stylesheets for...everything?
GNU General Public License v3.0
278 stars 43 forks source link

Fix custom link colors #19

Closed jgkamat closed 6 years ago

jgkamat commented 6 years ago

I'm planning on making my own variant of solarized-everything-css, one of the pros of this structure is the easy ability to restyle the web completely! (just like terminal applications, at least, that's my hope)

I found a small bug, preventing setting custom link colors set via dark.styl or similar.

alphapapa commented 6 years ago

Hey Jay,

I'm planning on making my own variant of solarized-everything-css,

Wow, that sounds really cool! I can't wait to see that. If you get it working, maybe we should consider collaborating on a common core that theme-specific sets could be layered on top of.

one of the pros of this structure is the easy ability to restyle the web completely! (just like terminal applications, at least, that's my hope)

I'm glad you think so. :) I did hope to reduce the friction for making new stylesheets.

There is an alternative approach that some of the other, more popular GitHub restyling projects have talked about or worked on: a script to replace all the colors in an existing stylesheet, e.g. replace all "red" with the Solarized red. It's a bit less flexible in that it only remaps colors, but for a lot of simple color theme swaps, it would probably be even more efficient, and it wouldn't require manual updating every time the "real" CSS changes--you'd just have to rerun the script to remap the colors. So you might want to look into that.

Even a plain sed script could do that, I guess. Come to think of it, I'm not sure why I didn't try that approach to begin with. I guess one disadvantage is that it requires collecting all the stylesheets to begin with, maybe combining them into a single one. But then, an advantage is that it might help avoid conflicts when the site's real CSS changes underneath.

Anyway, please do keep me updated on your project!

About this PR: sorry, I don't understand how this is a bug. It's just the hackernews.styl file, so it only applies to the HN site.

Are you using the all-sites CSS file? If so, I guess this could conflict with it, depending on what order the site-specific files are combined in. But that's basically a known issue with the all-sites file: it's messy, likely full of potential conflicts, and not guaranteed to work well. The site-specific and generic sheets are the ones that should be used in most cases.

Let me know what you think. Thanks.

jgkamat commented 6 years ago

I'm happy you like the idea! It actually was surprisingly easy to simply swap out the colors, and now I have themes that work magically for a bunch of the sites I use (wtih my color theme), which is the way the web should work :D.

2017-10-09-215348_906x520_scrot 2017-10-09-215522_1015x445_scrot 2017-10-09-215544_819x459_scrot 2017-10-09-215735_997x469_scrot

And best of all, any fixes/updates to solarized-everything gets downstreamed to me (and in reverse too) :)

I think that if people contribute a bunch to this (or a similar project) we can finally get easy, unified, drop-in themes for every site on the web! (although, I don't know how reasonable that is)

There is an alternative approach that some of the other, more popular GitHub restyling projects have talked about or worked on: a script to replace all the colors in an existing stylesheet, e.g. replace all "red" with the Solarized red. It's a bit less flexible in that it only remaps colors, but for a lot of simple color theme swaps, it would probably be even more efficient, and it wouldn't require manual updating every time the "real" CSS changes--you'd just have to rerun the script to remap the colors. So you might want to look into that.

That approach does seem pretty good, but I would be worried about handling every possible color that a website could throw at you. If you could define a color scheme as a function that translates colors, I think that that method would be perfect, but I'm fine with the way that this is laid out now. I'll definitely take a look though!

About this PR: sorry, I don't understand how this is a bug. It's just the hackernews.styl file, so it only applies to the HN site. Are you using the all-sites CSS file?

Yes, I actually am; I'm using qutebrowser, which only supports a single file right now. Hopefully per-domain settings will come out soon, which would solve the problem, but I'm using the all-sites file as a temporary solution until then. Because of ordering issues (I guess) this directive is overriding all the other link colors.

Either way, I think that this is still a problem because if people want to style their own link colors via the link color in dark.styl, the color won't take affect in hacker news, since it's hard-coded to blue in the hackernews file. For people using the default configs, it dosen't change anything (since link color is blue for both dark and light sheets), so I still think that merging this would be an improvement, to allow people's custom link colors to affect hackernews as well :)

alphapapa commented 6 years ago

Wow, those screenshots are really cool! Thanks for sharing. This gives me some ideas about other color themes I might want to try too...

I think that if people contribute a bunch to this (or a similar project) we can finally get easy, unified, drop-in themes for every site on the web! (although, I don't know how reasonable that is)

That would be really cool. :)

Yes, I actually am; I'm using qutebrowser, which only supports a single file right now. Hopefully per-domain settings will come out soon, which would solve the problem, but I'm using the all-sites file as a temporary solution until then. Because of ordering issues (I guess) this directive is overriding all the other link colors.

Ah, cool. Yeah, I'm keeping an eye on his project. When the site-specific rules come out, I will definitely be looking into it. I can see how the all-sites file is useful now, though.

Either way, I think that this is still a problem because if people want to style their own link colors via the link color in dark.styl, the color won't take affect in hacker news, since it's hard-coded to blue in the hackernews file. For people using the default configs, it dosen't change anything (since link color is blue for both dark and light sheets), so I still think that merging this would be an improvement, to allow people's custom link colors to affect hackernews as well :)

I understand now, thanks. It's actually redundant to set link colors to blue in that file. I'm not sure why I even did that. As you may have figured out, it's been a while since I've done much with this project, so I am foggy on the details of how I did some things. All that layering of abstractions is handy but is easily forgotten. :)

Anyway, I think the a section can be removed from the file altogether, because it should be set by the generic sheet, which is included by the index.styl file in every site sheet.

jgkamat commented 6 years ago

Anyway, I think the a section can be removed from the file altogether, because it should be set by the generic sheet, which is included by the index.styl file in every site sheet.

Ah, I didn't know about the sourcing, that's really neat! I've updated the PR accordingly :D

alphapapa commented 6 years ago

Ah, I didn't know about the sourcing, that's really neat! I've updated the PR accordingly :D

Yep, if you look at the hackernews CSS, that section is duplicated in the current master, but not in your PR. :) That's one thing that I wish Stylus did, remove redundancy, but I guess there are other projects that can post-process CSS to do that.

Thanks very much for your contributions!