[ZBXNEXT-3502] Ability to include custom CSS ("lightweight theme") Created: 2016 Oct 17  Updated: 2017 Sep 19

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: Frontend (F)
Affects Version/s: 3.2.1
Fix Version/s: None

Type: New Feature Request Priority: Trivial
Reporter: Janne Korkkula Assignee: Unassigned
Resolution: Unresolved Votes: 4
Labels: customisation, style, themes
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File aalto_zabbix.css     File aalto_zabbix_20170919.css     PNG File screenshot.Firefox.20161017T163855.png     PNG File screenshot.Firefox.20161017T163930.png     PNG File screenshot.Firefox.20161017T164023.png    

 Description   

It would be most convenient, if we could configure an URL for a custom style sheet, which would then be included as the last style sheet when serving pages.

Creating a custom theme is too heavy a solution for just tweaking minor issues, not least because a custom theme would not benefit from bugfixes and/or updates in the Zabbix distribution.

As it is, I decided to append a hack to browsers.js instead of changing the theme CSS file itself or modifying any PHP code:

/* Aalto custom style import, jannek 2016 */
var AaltoCssId = 'AaltoCss';
if (!document.getElementById(AaltoCssId))
{
    var head  = document.getElementsByTagName('head')[0];
    var link  = document.createElement('link');
    link.id   = AaltoCssId;
    link.rel  = 'stylesheet';
    link.type = 'text/css';
    link.href = '/css/aalto_zabbix.css';
    link.media = 'all';
    head.appendChild(link);
}

A bit ugly yes, but it works perfectly well and should survive updates nicely.

For curiosity, attached is our current additional style sheet for 3.2.1. It's very much more compact than the default.

This feature request is naturally related at least to ZBX-10504, "Get back compact 2.x web-interface layout".



 Comments   
Comment by richlv [ 2016 Oct 17 ]

do you have some screenshots of before/after, comparing to zabbix 3.0.5 ?

Comment by Janne Korkkula [ 2016 Oct 17 ]

As for 3.0.5, no; We went from 2.2.15 straight to 3.2.1 last Friday (out of context, I was quite impressed when the upgrade "just worked") and our test server doesn't have a database at all at the moment, so I can't do default/comparison shots from 3.2.1. It's a bit of a no-no to publish production stuff, but I'll add something generic with a bit of whiteout here and there.

Comment by Janne Korkkula [ 2016 Oct 17 ]

3.2.1 with standard blue theme and custom CSS. Firefox 49 on Ubuntu 14.04.

Comment by richlv [ 2016 Oct 17 ]

that's very neat, stuff actually fits onscreen like that
while later 3.0 versions improved a bit upon the initial bloat, your version is even better. voted.

Comment by Janne Korkkula [ 2016 Oct 17 ]

Well, thanks, but...
Maybe this should be split into two separate issues, as improving the standard theme isn't what this one is all about: a simple, update-proof way of including a custom (override) CSS to all relevant pages - perhaps via a configuration field named "Custom CSS URL" in the frontend Administration/General/GUI tab.

Comment by richlv [ 2016 Oct 17 ]

you are absolutely right, i was a bit lazy there
ZBXNEXT-3504 created

Comment by richlv [ 2016 Oct 17 ]

ZBXNEXT-345 asks for css override for the login page only - might be covered by this issue

Comment by richlv [ 2016 Oct 17 ]

ZBXNEXT-260 is similar

Comment by Janne Korkkula [ 2017 Sep 19 ]

Just added one padding-killer more, .screen-table .list-table td {
padding: 2px 5px; }

Generated at Wed Apr 24 20:16:31 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.