# HG changeset patch # User domruf # Date 1508956642 -7200 # Node ID 8152f9e6a7785835e268da63bafd7923e1b2cd81 # Parent f5f796c77337cb6b97415112361a8a7bcc32a1c6 less: load optional theme.less file to allow custom styles Users can use this file to easily override the default style. For example they can override the theme main color or the logo url. diff -r f5f796c77337 -r 8152f9e6a778 .hgignore --- a/.hgignore Tue Oct 24 21:41:07 2017 +0200 +++ b/.hgignore Wed Oct 25 20:37:22 2017 +0200 @@ -23,6 +23,7 @@ ^\.pydevproject$ ^\.coverage$ ^kallithea/public/css/style\.css$ +^theme\.less$ ^kallithea\.db$ ^test\.db$ ^Kallithea\.egg-info$ diff -r f5f796c77337 -r 8152f9e6a778 docs/usage/customization.rst --- a/docs/usage/customization.rst Tue Oct 24 21:41:07 2017 +0200 +++ b/docs/usage/customization.rst Wed Oct 25 20:37:22 2017 +0200 @@ -18,6 +18,29 @@ block*. +Style sheet customization with Less +----------------------------------- + +Kallithea uses `Bootstrap 3`_ and Less_ for its style definitions. If you want +to make some customizations, we recommend to do so by creating a ``theme.less`` +file. When you create a file named ``theme.less`` in the Kallithea root +directory, you can use this file to override the default style. For example, +you can use this to override ``@kallithea-theme-main-color``, +``@kallithea-logo-url`` or other `Bootstrap variables`_. + +After creating the ``theme.less`` file, you need to regenerate the CSS files. +Install npm for your platform and run:: + + npm install + npm run less + +in the Kallithea root directory. + +.. _bootstrap 3: https://getbootstrap.com/docs/3.3/ +.. _bootstrap variables: https://getbootstrap.com/docs/3.3/customize/#less-variables +.. _less: http://lesscss.org/ + + Behavioral customization: rcextensions -------------------------------------- diff -r f5f796c77337 -r 8152f9e6a778 kallithea/public/less/main.less --- a/kallithea/public/less/main.less Tue Oct 24 21:41:07 2017 +0200 +++ b/kallithea/public/less/main.less Wed Oct 25 20:37:22 2017 +0200 @@ -23,3 +23,6 @@ @import "kallithea-select2.less"; @import "kallithea-diff.less"; @import "style.less"; + +/* finally, import the optional theme file with local customizations */ +@import (optional) "theme.less";