svenstaro / miniserve

🌟 For when you really just want to serve some files over HTTP right now!
MIT License
6.07k stars 293 forks source link

Rework colors #51

Closed svenstaro closed 5 years ago

svenstaro commented 5 years ago

Currently I'm not super happy with how everything looks. It has a pale color palette without good contrast. It should have better contrast.

ghost commented 5 years ago

Should be easy, do you have a colorscheme or an application you like design-wise ?

Edit: removed outdated screenshot

Here's a little fun based on an Arch-like palette :) I also added some padding.

svenstaro commented 5 years ago

I actually kinda like that colorscheme. Actualllly how about colorscheme support? We could provide a bunch of colorschemes. The few bytes won't make it too bloaty and another added CLI option won't kill us.

Yeah but generally I also want a more contrasted default color scheme that still looks clean but just has better contrast than the current one.

ghost commented 5 years ago

Sure, great idea. I'll be on it then ;) By support, do you mean being able to read actual tmTheme files from known themes (Monokai, etc) ? Or should I hardcode the themes ? I think we don't need the whole themes, we basically need 8-10 colors max, so I would go for hardcoding them.

struct MonokaiTheme {
  background: "abcdef",
  text_color: "eeeeee",
  link_color: "ffffff"
  ...
}

Something like this (that's not valid syntax but you get it :P)

svenstaro commented 5 years ago

Yes, absolutely go for hard coding them.

svenstaro commented 5 years ago

Maybe actually in the form of having a different CSS template files? I'm not sure which would be better.

ghost commented 5 years ago

If we only change colors, I think the first option is the easiest. If we want to have actual themes and not only color schemes, the latter option is the best.

I'll start with the first one, we'll see how it goes

svenstaro commented 5 years ago

Sounds good.

On Tue, 26 Mar 2019 at 22:06, Boastful Squirrel notifications@github.com wrote:

If we only change colors, I think the first option is the easiest. If we want to have actual themes and not only color schemes, the latter option is the best.

I'll start with the first one, we'll see how it goes

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/svenstaro/miniserve/issues/51#issuecomment-476852733, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAGgDayfmeyW0P1NMIdd58Mcz66zX3Xks5vaovvgaJpZM4cFa6y .

svenstaro commented 5 years ago

While you're at it. I somehow really don't like the way the date is formatted under Last modification. It seems weirdly spaced out. Can you play around with that as well?

On Tue, 26 Mar 2019 at 23:04, Boastful Squirrel notifications@github.com wrote:

I'm doing good progress. I'll create the PR once I created enough themes.

Here's my version of Zenburn: [image: Screenshot 2019-03-26 at 23 02 22] https://user-images.githubusercontent.com/47121073/55036594-6a57f880-501b-11e9-8f31-0efba1dcb8af.png

Everything can be customized if you don't like a color, I already parametrized all the CSS.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/svenstaro/miniserve/issues/51#issuecomment-476871076, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAGgAFN5fShf2ACKje-7TO3R49NIMWzks5vaplkgaJpZM4cFa6y .

ghost commented 5 years ago

Sure, how would you want it to be ?

svenstaro commented 5 years ago

I honestly don't know :P I'd probably play around with it a bit and look at how other software represents the dates.

svenstaro commented 5 years ago

I like the a lot more than what we have currently! Also try putting the time just in front of the date and see how it looks.

On Tue, Mar 26, 2019, 23:29 Boastful Squirrel notifications@github.com wrote:

OK, I'll look at this.

In the meantime, I came up with that: [image: Screenshot 2019-03-26 at 23 28 34] https://user-images.githubusercontent.com/47121073/55037699-e6a00b00-501e-11e9-91e4-447d9312e0ca.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/svenstaro/miniserve/issues/51#issuecomment-476877799, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAGgMIFqfRiOrM0qcs1sWLCQDvqDmx2ks5vap8_gaJpZM4cFa6y .

ghost commented 5 years ago

I'll keep experimenting :)

By the way, instead of doing it a CLI argument, I did a theme chooser in pure CSS, and the theme has become a query parameter. Since theme is really up to the client, I found it wierd to set it at CLI-level, kind of like sorting.

Still a prototype, but it looks like this at the moment:

Edit: removed outdated screenshot

svenstaro commented 5 years ago

You make a very good point and I agree.

On Wed, 27 Mar 2019 at 23:52, Boastful Squirrel notifications@github.com wrote:

I'll keep experimenting :)

By the way, instead of doing it a CLI argument, I did a theme chooser in pure CSS, and the theme has become a query parameter. Since theme is really up to the client, I found it wierd to set it at CLI-level, kind of like sorting.

Still a prototype, but it looks like this at the moment: [image: Screenshot 2019-03-27 at 23 49 30] https://user-images.githubusercontent.com/47121073/55117471-419f3400-50eb-11e9-9264-3441cb2d80ef.png

Note that all the colors depends on which theme is set.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/svenstaro/miniserve/issues/51#issuecomment-477377285, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAGgCJO4oYhRrb9D4oqhHt2CwC4wGZ1ks5va_YcgaJpZM4cFa6y .

svenstaro commented 5 years ago

Why use a constructor at all? Why not just put a few preconstructed themes in the module and call it a day? I don't really see a need for new() here.

On Fri, Mar 29, 2019, 19:09 Boastful Squirrel notifications@github.com wrote:

I'm currently trying to find an elegant way to "instanciate" a theme. The struct associated to a theme is quite big, and right now I did something like this: https://gist.github.com/boastful-squirrel/dcb4105fe4cef910355a4eb9de7c9c12 which I find a bit too verbose.

Taking an &[&str] as parameter of Theme::new() would probably less verbose, though I don't think that's a very clean way of handling such a case.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/svenstaro/miniserve/issues/51#issuecomment-478096931, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAGgMCTpQ2gW7w04LSwdw3IyV_9y4Pmks5vbla9gaJpZM4cFa6y .