FChannel0 / FChannel-Server

GNU Affero General Public License v3.0
106 stars 14 forks source link

Themes #52

Closed ghost closed 3 years ago

ghost commented 3 years ago

this series of commits adds themes to fchan. it's basic, but it works. i'll improve upon this later, but it works well enough now as far as i know.

tl;dr of changes:

seth-scherer commented 3 years ago

is there a way to implement this without javascript? fchan has been trying to decrease the amount of javascript used, not increase. If not, it's not a big deal since this is optional, but ideally a JS-less implementation would be nice.

ghost commented 3 years ago

in some browsers, you can change the page style, but at least in firefox it doesn't stick. ungoogled chromium (and i'll assume by extension, chromium) i can't find any way to actually change it without an extension or javascript.

another route we could go down that i hate involves doing this server side, so we take in the theme cookie (and set it via a form or something) and do some stuff in static/main.html to set the default style. i don't really like this since it would require another POST route to do nothing but set the theme cookie, then you'd have a CookieTheme field in PageData/AdminPage/etc structs for templates which will decide which theme will be marked as the default stylesheet. not sure how to go about implementing this and i hate it anyway.

FChannel0 commented 3 years ago

thanks for organizing the styling. as for javascript less, as long as the site is functioning w/o javascript it should be fine. users should expect that javascript will have less features than with. like what was stated, it could be moved server side, but are users that want no javascript also expecting themes? i would think they would want less not more functionality in some regards.

going to test theses changes on fchan and 0xchan, a lot was moved around lets see if it holds.

ghost commented 3 years ago

i've already noticed a few (visual) issues myself i didn't notice when testing locally. another PR very soon... but i guess this is what the development branch is for.

half of these are already fixed locally. if there's anything else wrong let me know.