Encapsulate header-theme example plugin in a Gerrit.install call
To make it more clear that you still need Gerrit.install for DOM styling.
Release-Notes: skip
Bug: Issue 16031
Change-Id: Ib0970d66adfa3f6d7924d3fc582d7d24af188d30
diff --git a/Documentation/pg-plugin-dev.txt b/Documentation/pg-plugin-dev.txt
index b8a30ee..3f7d90d 100644
--- a/Documentation/pg-plugin-dev.txt
+++ b/Documentation/pg-plugin-dev.txt
@@ -101,16 +101,18 @@
Just add code like this to your JavaScript plugin:
``` js
- const styleEl = document.createElement('style');
- styleEl.innerHTML = `
- html {
- --header-background-color: #c3d9ff;
- }
- html.darkTheme {
- --header-background-color: #c3d9ff90;
- }
- `;
- document.head.appendChild(styleEl);
+Gerrit.install(plugin => {
+ const styleEl = document.createElement('style');
+ styleEl.innerHTML = `
+ html {
+ --header-background-color: #c3d9ff;
+ }
+ html.darkTheme {
+ --header-background-color: #c3d9ff90;
+ }
+ `;
+ document.head.appendChild(styleEl);
+});
```
[[high-level-api-concepts]]