Using css Mako templates to make the styles configurable

Mads Kiilerich mads at kiilerich.com
Mon Feb 29 11:09:38 UTC 2016


On 02/27/2016 04:40 PM, Angel Ezquerra wrote:
> Hi,
>
> this is something that has probably already been discussed but please
> bear with me since I am new to Kallithea and mako. I've been wondering
> about what would be the best way to make the Kallithea look
> configurable. CSS is a bit annoying in this regard because it does not
> support variables or anything of the sort. However it could be
> possible to change the existing CSS and turn it into mako templates,
> couldn't it? Then it would "just" be a matter of adding some UI to
> select the colors of the different UI elements.
>
> Would that make sense? Which drawbacks would there be?

The main drawback would be that the css no longer would be static and 
thus is less trivial to cache - worst case the browser would have to 
fetch it for every page load.

There are solutions to that, but we currently don't use those.

We try to make step towards cleaning up and following existing best 
practice. 
https://bitbucket.org/conservancy/kallithea/pull-requests/167/port-kallithea-theme-to-bootstrap-wip/diff 
will take a big step in that direction.

(At Unity we currently just tweak style.css in one of the patches we 
have on top of the upstream default branch.)

/Mads


More information about the kallithea-general mailing list