From 7b6125aace37e29704e4e3b46b36ca6dbe0c23dd Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 27 Apr 2023 11:56:20 +1000 Subject: [PATCH] gerrit: update OpenDev theme CSS installation registerStyleModule has been deprecated for a few releases, and is removed in 3.8. This inserts the style element directly, as suggested by the Gerrit plugin documentation [1]. [1] https://gerrit-documentation.storage.googleapis.com/Documentation/3.7.2/pg-plugin-dev.html#low-level-style Change-Id: I23600754dc35a9d455e611ac25a6162b2e973a03 --- .../files/plugins/opendev-theme-plugin.js | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/playbooks/zuul/gerrit/files/plugins/opendev-theme-plugin.js b/playbooks/zuul/gerrit/files/plugins/opendev-theme-plugin.js index 38742f075a..2c07530113 100644 --- a/playbooks/zuul/gerrit/files/plugins/opendev-theme-plugin.js +++ b/playbooks/zuul/gerrit/files/plugins/opendev-theme-plugin.js @@ -17,23 +17,17 @@ 'use strict'; -const openDevThemeStyle = document.createElement('dom-module'); -openDevThemeStyle.innerHTML = ` - -`; -openDevThemeStyle.register('opendev-site-theme'); - Gerrit.install(plugin => { - plugin.registerStyleModule('app-theme', 'opendev-site-theme'); + const styleEl = document.createElement('style'); + styleEl.innerHTML = ` + html { + --header-title-content: "OpenDev"; + --header-icon: url("/static/opendev-sm.png"); + --header-background-color: var(--background-color-primary); + --header-icon-size: 1.2em; + --header-border-bottom: 1px solid; + --header-border-image: linear-gradient(to right, #ee265e, #f9b8cb, #ee265e) 1; + } + `; + document.head.appendChild(styleEl); });