DEV: Add theme-color meta to bootstrap (#13615)

DEV: Add theme-color meta to bootstrap (#13615)

It’s rendered in Rails in:

https://github.com/discourse/discourse/blob/ebcc70a5bafba06b48449136eb6dd4a1db16254c/app/views/layouts/_head.html.erb#L9-L9

diff --git a/app/assets/javascripts/discourse/lib/bootstrap-json/index.js b/app/assets/javascripts/discourse/lib/bootstrap-json/index.js
index f2cb94c..f062d50 100644
--- a/app/assets/javascripts/discourse/lib/bootstrap-json/index.js
+++ b/app/assets/javascripts/discourse/lib/bootstrap-json/index.js
@@ -34,12 +34,17 @@ function head(buffer, bootstrap) {
     buffer.push(`<meta name="csrf-param" content="authenticity_token">`);
     buffer.push(`<meta name="csrf-token" content="${bootstrap.csrf_token}">`);
   }
+
   if (bootstrap.theme_id) {
     buffer.push(
       `<meta name="discourse_theme_id" content="${bootstrap.theme_id}">`
     );
   }
 
+  if (bootstrap.theme_color) {
+    buffer.push(`<meta name="theme-color" content="${bootstrap.theme_color}">`);
+  }
+
   let setupData = "";
   Object.keys(bootstrap.setup_data).forEach((sd) => {
     let val = bootstrap.setup_data[sd];
diff --git a/app/controllers/bootstrap_controller.rb b/app/controllers/bootstrap_controller.rb
index e10120e..4f2f40a 100644
--- a/app/controllers/bootstrap_controller.rb
+++ b/app/controllers/bootstrap_controller.rb
@@ -54,6 +54,7 @@ class BootstrapController < ApplicationController
 
     bootstrap = {
       theme_id: theme_id,
+      theme_color: "##{ColorScheme.hex_for_name('header_background', scheme_id)}",
       title: SiteSetting.title,
       current_homepage: current_homepage,
       locale_script: locale,

GitHub sha: fdb85b802564b4089b85d17791476f2b2f0ef118

This commit appears in #13615 which was approved by eviltrout. It was merged by CvX.