]> BookStack Code Mirror - bookstack/commitdiff
Updated migration to carry across more colors, updated export
authorDan Brown <redacted>
Sat, 28 Jan 2023 17:49:48 +0000 (17:49 +0000)
committerDan Brown <redacted>
Sat, 28 Jan 2023 17:49:48 +0000 (17:49 +0000)
Updated export to use link color for link.
Export will now copy primary color to link color options for stable
upgrades.

database/migrations/2023_01_28_141230_copy_color_settings_for_dark_mode.php
resources/views/exports/parts/styles.blade.php

index b72b1616252b459da4ed1fd2b2bb1d51e51ba3a3..eb779fc7bf1e27888a7822f6d2df56225f3a2d69 100644 (file)
@@ -31,6 +31,13 @@ class CopyColorSettingsForDarkMode extends Migration
             $newSetting = (array) $setting;
             $newSetting['setting_key'] .= '-dark';
             $newData[] = $newSetting;
             $newSetting = (array) $setting;
             $newSetting['setting_key'] .= '-dark';
             $newData[] = $newSetting;
+
+            if ($newSetting['setting_key'] === 'app-color-dark') {
+                $newSetting['setting_key'] = 'link-color';
+                $newData[] = $newSetting;
+                $newSetting['setting_key'] = 'link-color-dark';
+                $newData[] = $newSetting;
+            }
         }
 
         DB::table('settings')->insert($newData);
         }
 
         DB::table('settings')->insert($newData);
@@ -45,6 +52,8 @@ class CopyColorSettingsForDarkMode extends Migration
     {
         $colorSettings = [
             'app-color-dark',
     {
         $colorSettings = [
             'app-color-dark',
+            'link-color',
+            'link-color-dark',
             'app-color-light-dark',
             'bookshelf-color-dark',
             'book-color-dark',
             'app-color-light-dark',
             'bookshelf-color-dark',
             'book-color-dark',
index 830b8e49a818255b0f50e59158de54445e63ea26..f570ff51246eb58135f7c188c5fcce7c9c361d45 100644 (file)
@@ -10,7 +10,7 @@
     <style>
         /* Patches for CSS variable colors within PDF exports */
         a {
     <style>
         /* Patches for CSS variable colors within PDF exports */
         a {
-            color: {{ setting('app-color') }};
+            color: {{ setting('app-link') }};
         }
 
         blockquote {
         }
 
         blockquote {