Giter Club home page Giter Club logo

zabbix_automaticdarkmode's Introduction

Simple Custom Theme CSS that loads Dark/Blue Theme based on "prefers-color-scheme" Media Query.

Installation Instructions

  1. Copy APP.php to /usr/share/zabbix/include/classes/core/APP.php
    This File adds a "Auto Theme" to the Default Theme pool by overriding the Method getThemes() from ZBase.
    If you already have a File like this simply add this Code your class APP extends ZBase
    public static function getThemes() {
        return array_merge(parent::getThemes(), [
            /* 'css_file_name_without_extension' => _('theme_name_in_ui') */
                'automatic_dark_mode' => _('Auto Theme')
        ]);
    }
  2. Copy automatic_dark_mode.css to /usr/share/zabbix/assets/style/auto_dark_mode.css
    This CSS File simply imports either blue-theme.css or dark-theme.css depending on what the media query prefers-color-scheme returns. (dark/light) You can also import alternate *.css Files by simply changing url('<file>').

After you restart the Zabbix Frontend, a new Theme called Auto Theme should appear.

Installation Instructions with Docker Compose

  1. Create a Data or Provisioning Folder withing you Compose Project
    The "Source" Files will be placed in this Directory
    Only APP.php and automatic_dark_mode.css is required
  2. Added Read-Only Mounts to your Docker Compose File
    volumes:
        - ./provisioning/zabbix/frontend/APP.php:/usr/share/zabbix/include/classes/core/APP.php:ro
        - ./provisioning/zabbix/frontend/automatic_dark_mode.css:/usr/share/zabbix/assets/styles/automatic_dark_mode.css:ro
    This will add both Files as Read-Only Mounts

This should be enough, but depending on your Docker Compose Project you might need to
complete additonal steps

Open Tasks:

  • Make this Work with Color Schemes from Graphs/Plots. Those are not controlled by CSS but by a PHP Code in charts<0-7>.php

zabbix_automaticdarkmode's People

Contributors

oliverkarger avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.