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
This commit is contained in:
Ian Wienand 2023-04-27 11:56:20 +10:00
parent 276396babc
commit 7b6125aace
No known key found for this signature in database

@ -17,10 +17,9 @@
'use strict'; 'use strict';
const openDevThemeStyle = document.createElement('dom-module'); Gerrit.install(plugin => {
openDevThemeStyle.innerHTML = ` const styleEl = document.createElement('style');
<template> styleEl.innerHTML = `
<style>
html { html {
--header-title-content: "OpenDev"; --header-title-content: "OpenDev";
--header-icon: url("/static/opendev-sm.png"); --header-icon: url("/static/opendev-sm.png");
@ -29,11 +28,6 @@ openDevThemeStyle.innerHTML = `
--header-border-bottom: 1px solid; --header-border-bottom: 1px solid;
--header-border-image: linear-gradient(to right, #ee265e, #f9b8cb, #ee265e) 1; --header-border-image: linear-gradient(to right, #ee265e, #f9b8cb, #ee265e) 1;
} }
</style> `;
</template> document.head.appendChild(styleEl);
`;
openDevThemeStyle.register('opendev-site-theme');
Gerrit.install(plugin => {
plugin.registerStyleModule('app-theme', 'opendev-site-theme');
}); });