rmountjoy92/DashMachine

Feature: Theme support

Opened this issue · 0 comments

What about adding full jinja template theme support to dashmachine? So that people can come up with their own themes (almost) completely from scratch?

The way I usually approach it in my project is that I wrap render_template into a render_template_themed and what it does it checks current theme name in config and appends it to template file's path. So, for example:

render_template_themed("index.html")
# Will turn it into
render_template("/bootstrap4/index.html")

And from there possibilities are basically endless. Separate folders for each t heme inside templates folder and static folder. Some refactoring may be required on the platforms\Custom cards front, as currently some of them return HTML code, that should probably be replaced into returning jinja rendered templates as well. Maybe each platform should have it's own file inside of templates\themename folder, so each theme\template can adjust how that platform data is rendered.

This is one way of doing it, of course. Could go all frontend\backend separation crazy, but I'm not sure it's required here.

I think this will really bring this project even further from "Just another cool dashboard" into a full on framework and ecosystem that can be built around.

Whatcha think?