You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ferrite: fifteen themes on Flux (Classic Mac, Amiga, Nokia 3310...) in a self-hosted file server
#2855
I've built a self-hosted file server with Laravel, Livewire and Flux UI, and ended up making fifteen themes on top of Flux, from a calm dark default to Classic Mac, Amiga, a Nokia 3310 LCD and Miami Vice. Each user picks their own.
Each theme is a CSS block keyed on a data-palette attribute on <html>. It redefines the zinc scale and --color-accent, plus the radius and shadow variables, so Flux's components follow without touching their markup.
Fonts, corners and decoration are part of the theme (a pixel font and square corners for the retro ones, a status bar for the Nokia, a rule across the top for others), not only colours.
A few things needed workarounds: Flux draws buttons and fields in plain white, so the Nokia LCD theme overrides --color-white. Dialogs reset their text colour, so I made them inherit the page's. Light and dark themes share the dark class, so each theme says which it is.
What I'd like to know: is overriding the zinc scale the intended way to go this far, or is there a better hook I'm missing? And has anyone else tried "character" themes (fonts and shapes, not just colours) on Flux?
Limits: Flux is hard-coded to zinc, so a new Flux release could need a check on every theme. Feedback welcome.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Demo (one click, throwaway account): https://demo.ferrite.stackcare.pt, then Settings > Appearance
Code (AGPL-3.0): https://github.com/zhoorta/ferrite, with notes in
docs/themes.mdHow the theming works, in case it is useful:
data-paletteattribute on<html>. It redefines the zinc scale and--color-accent, plus the radius and shadow variables, so Flux's components follow without touching their markup.--color-white. Dialogs reset their text colour, so I made them inherit the page's. Light and dark themes share thedarkclass, so each theme says which it is.What I'd like to know: is overriding the zinc scale the intended way to go this far, or is there a better hook I'm missing? And has anyone else tried "character" themes (fonts and shapes, not just colours) on Flux?
Limits: Flux is hard-coded to zinc, so a new Flux release could need a check on every theme. Feedback welcome.
All reactions