File: 003-override-darken-lighten.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 (25 lines) | stat: -rw-r--r-- 1,104 bytes parent folder | download | duplicates (2)
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
diff --git a/inst/lib/bs3/assets/stylesheets/bootstrap/_variables.scss b/inst/lib/bs3/assets/stylesheets/bootstrap/_variables.scss
index da7020a..be24292 100644
--- a/inst/lib/bs3/assets/stylesheets/bootstrap/_variables.scss
+++ b/inst/lib/bs3/assets/stylesheets/bootstrap/_variables.scss
@@ -31,6 +31,19 @@ $body-bg:               #fff !default;
 //** Global text color on `<body>`.
 $text-color:            $gray-dark !default;
 
+// BS3 source uses a lot of darken()/lighten() which doesn't work well
+// for both dark/light themes, so here we override their meaning to be
+// * darken(): pull $color towards $gray-base by $percent
+// * lighten(): pull $color towards $white by $percent
+// (note that bs3_base_theme_colors() sets $white to be the bg color)
+$white: $body-bg !default;
+@function darken($color, $percent) {
+    @return mix($gray-base, $color, $percent);
+}
+@function lighten($color, $percent) {
+    @return mix($white, $color, $percent);
+}
+
 //** Global textual link color.
 $link-color:            $brand-primary !default;
 //** Link hover color set via `darken()` function.