Theme tweaking with CSS variables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9456

    #1

    Theme tweaking with CSS variables

    1. Create a file custom/Espo/Custom/Resources/metadata/client.json:

    Code:
    {
        "cssList": [
            "__APPEND__",
            "client/custom/css/my-theme-tweaks.css"
        ]
    }
    Note that the file may already exist. In this case, modify the file, keep the JSON valid.

    2. Create a file client/custom/css/my-theme-tweaks.css:

    Code:
    :root {
        --navbar-inverse-color: #b9b9b9;
        --navbar-inverse-bg: #3a61a1;
        --navbar-inverse-link-color: #c6c6c6;
        --navbar-inverse-link-active-bg: #254377;
        --navbar-inverse-border: #3a61a1;
        --navbar-inverse-toggle-hover-bg: #d3d9e0;
        --navbar-inverse-link-hover-color: #dddddd;
        --navbar-inverse-link-hover-bg: #304f8a;
        --navbar-inverse-link-disabled-color: #8e8e8e;
        --navbar-inverse-link-icon-color: #efefef;
        --navbar-inverse-link-icon-hover-color: #cacaca;
    }
    This will change the navbar colors as on the screenshot.

    Click image for larger version  Name:	image.png Views:	0 Size:	14.6 KB ID:	122184

    3. Clear cache in Espo.

    Note. As of v9.2.3, it's possible to apply variables to a particular theme only (except for the login screen):

    Code:
    :root {
        body[data-theme-name="ThemeName"] {
        }
    }
    Where, ThemeName is the name of the theme, e.g. 'Violet'.
    Last edited by yuri; Today, 10:45 AM.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.
Working...