File: 025-default-theme-color.patch

package info (click to toggle)
r-cran-bslib 0.9.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,412 kB
  • sloc: javascript: 13,349; makefile: 33; sh: 23
file content (52 lines) | stat: -rw-r--r-- 2,079 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
diff --git a/inst/lib/bs4/scss/_variables.scss b/inst/lib/bs4/scss/_variables.scss
index 42d8142..dde6f2f 100644
--- a/inst/lib/bs4/scss/_variables.scss
+++ b/inst/lib/bs4/scss/_variables.scss
@@ -66,6 +66,11 @@ $colors: map-merge(
   $colors
 );
 
+// Semantically, $secondary is closest to BS3's 'default' theme color; 
+// so use that if specified. Otherwise, use a light instead of dark gray
+// default color for $default since that's closer to bootstrap 3's default
+$default: if(variable-exists("secondary") and type-of($secondary) == color, $secondary, $gray-300) !default;
+
 $primary:       $blue !default;
 $secondary:     $gray-600 !default;
 $success:       $green !default;
@@ -78,6 +83,9 @@ $dark:          $gray-800 !default;
 $theme-colors: () !default;
 $theme-colors: map-merge(
   (
+    // default needs to be 1st so that .btn-default comes before .btn-primary
+    // & therefore has lower priority.
+    "default":    $default,
     "primary":    $primary,
     "secondary":  $secondary,
     "success":    $success,
diff --git a/inst/lib/bs5/scss/_variables.scss b/inst/lib/bs5/scss/_variables.scss
index 706ee935..2ce8afc1 100644
--- a/inst/lib/bs5/scss/_variables.scss
+++ b/inst/lib/bs5/scss/_variables.scss
@@ -297,6 +297,11 @@ $cyans: (
 ) !default;
 // fusv-enable
 
+// Semantically, $secondary is closest to BS3's 'default' theme color;
+// so use that if specified. Otherwise, use a light instead of dark gray
+// default color for $default since that's closer to bootstrap 3's default
+$default: if(variable-exists("secondary") and type-of($secondary) == color, $secondary, $gray-300) !default;
+
 // scss-docs-start theme-color-variables
 $primary:       $blue !default;
 $secondary:     $gray-600 !default;
@@ -79,6 +84,9 @@ $dark:          $gray-900 !default;
 
 // scss-docs-start theme-colors-map
 $theme-colors: (
+  // default needs to be 1st so that .btn-default comes before .btn-primary
+  // & therefore has lower priority.
+  "default":    $default,
   "primary":    $primary,
   "secondary":  $secondary,
   "success":    $success,