Open tziporaziegler opened 7 years ago
Yes, this would be possible. It would be quite a bit less work if there's already one in existence, which has an appropriate license. Do you know of one off the top of your head? I can look around for one, or attempt to adjust what exists on SO (which would be much more work).
@makyen No, I haven't come across one yet. Wouldn't you be able to take the code from addCssG00glen00bModifiedDarkTheme()
as a base though, and just change the colors?
Yeah, it shouldn't be all that much work. I was just checking for a shortcut first :-).
I just got notified of your comment. I'm sorry for the delay in responding. I appreciate the work. I'm happy to have additional themes in the code. In fact, it was my intent/hope that would happen.
So that you know, I was working on the theme issue today. Unfortunately, I've changed that section completely. I'm sorry that my doing so will result in much of the work you've done in that area to be difficult to translate directly into the new code. The information will transfer, but it's not as CSS. A theme is now completely described by parameters, but retaining the possibility for some per-theme custom CSS when needed (e.g. the dark theme gets a light copy of MSO's logo). The overall intent behind this re-write was to make creating themes easier.
I've implemented a light theme matching SO's current theme, and a dark theme matching MSE's current theme (issue #6), along with keeping the current dark theme. While those themes are not a perfect match to SO/SE, they're close. I still need to add the preferences UI to allow them to be selected.
My intent is to allow people to select the theme they desire on a per-site basis (site(s) selected via user-entered RegExp is the current plan, but I'm open to suggestions). In addition, the plan is for the user to be able to define custom themes. I'm not sure if I'll have a good UI for defining custom themes with the next release, but it should at least be possible (even if it's the user has to enter a JSON string with the values). I'm hoping for something a bit better than that as far as UI goes, but that's the fallback.
My plan is a release within the next day with the code described above, along with an implementation of issues #5 (done), #10 (done), and the code which was tested for #4 (but I still need to revisit #4 yet again to see if I can re-re-re-verify/duplicate the new HTML).
@makyen I left that note in hope that this wouldn't happen. Oh well :) I guess you can close my pull request #12 as not going to be merged.
Your idea does sounds nice. It's probably also a neater solution than my repetitious code :)
As for the code I wrote, I tried to copy as much of the CSS I used from the SO main CSS file, so if anything, you may be able to use my code to get more accurate colors.
Thanks again for this great script!
@tziporaziegler, I'm glad you like the script. I'm sorry this overlap of effort occurred. I appreciate you trying to prevent it. Unfortunately, the timing ended up matching up with both me having my nose in code, then being called away form my computer and phone unexpectedly, about a half hour after you posted the comment, without me seeing the notification. Basically, it matched up with in the longest period that I've been away from communication in the last couple/few/many days. Sorry about that.
Yeah, when I was contemplating implementing the light theme (and the dark one matching MSE plus any other themes someone might want) the repetitious code was something that stood out as frustrating. I had also had in the back of my mind the desire to let users define their own themes. Keeping themes implemented primarily in CSS inherently requires lots of repetition and effectively means that it's difficult for someone to define a theme.
What I've implemented still allows you to use as much CSS as you want, but for most things you just have to define the colors. Where appropriate, you only have to define a color once. For example, you can define the background
color. If you choose not to define unique colors for other things which would normally also be that color, then the background color is used (e.g. it's used as the border color for some elements, which you can, but usually wouldn't define as their own colors).
Similar to the option "Dark Top-Nav theme on Stack Overflow and Meta Stack Overflow", are you able to add an option to do just the opposite, and change all the other Stack Exchange sites to a "Light Top-Nav theme" that matches SO?