File: 006-bootswatch-darkly-bs5.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 (263 lines) | stat: -rw-r--r-- 10,009 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
diff --git a/inst/lib/bsw5/dist/darkly/_bootswatch.scss b/inst/lib/bsw5/dist/darkly/_bootswatch.scss
index 6a4caa08..e7f15d3f 100644
--- a/inst/lib/bsw5/dist/darkly/_bootswatch.scss
+++ b/inst/lib/bsw5/dist/darkly/_bootswatch.scss
@@ -13,7 +13,7 @@ $web-font-path: "https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0
 
 .blockquote {
   &-footer {
-    color: $gray-600;
+    color: body-mix(75%);
   }
 }
 
@@ -21,7 +21,7 @@ $web-font-path: "https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0
 
 @include color-mode(dark) {
   .input-group-text {
-    // color: $white;
+    // color: $body-color;
   }
 }
 
@@ -44,12 +44,12 @@ $web-font-path: "https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0
   .nav-item.open .nav-link,
   .nav-item.open .nav-link:focus,
   .nav-item.open .nav-link:hover {
-    color: $white;
+    color: $body-color;
   }
 }
 
 .breadcrumb a {
-  color: $white;
+  color: $body-color;
 }
 
 .pagination {
@@ -61,19 +61,19 @@ $web-font-path: "https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0
 // Indicators
 
 .alert {
-  color: $white;
+  color: $body-color;
   border: none;
 
   a,
   .alert-link {
-    color: $white;
+    color: $body-color;
     text-decoration: underline;
   }
 
   @each $color, $value in $theme-colors {
     &-#{$color} {
       @if $enable-gradients {
-        background: $value linear-gradient(180deg, mix($white, $value, 15%), $value) repeat-x;
+        background: $value linear-gradient(180deg, mix($body-color, $value, 15%), $value) repeat-x;
       } @else {
         background-color: $value;
       }
diff --git a/inst/lib/bsw5/dist/darkly/_variables.scss b/inst/lib/bsw5/dist/darkly/_variables.scss
index d44daf4b..dc997b4a 100755
--- a/inst/lib/bsw5/dist/darkly/_variables.scss
+++ b/inst/lib/bsw5/dist/darkly/_variables.scss
@@ -30,22 +30,28 @@ $green:   #00bc8c !default;
 $teal:    #20c997 !default;
 $cyan:    #3498db !default;
 
+// Body
+
+$body-bg:                   $gray-900 !default;
+$body-color:                $white !default;
+@function body-mix($weight) {
+    @return mix($body-bg, $body-color, $weight);
+}
+
 $primary:       $blue !default;
-$secondary:     $gray-700 !default;
+$secondary:     body-mix(85%) !default;
 $success:       $green !default;
 $info:          $cyan !default;
 $warning:       $yellow !default;
 $danger:        $red !default;
-$light:         $gray-500 !default;
-$dark:          $gray-800 !default;
+// This is inconsistent with Bootstrap semantics. That is, $dark
+// should actually be a light color in a dark mode setting, :shrug:
+// https://github.com/thomaspark/bootswatch/issues/989
+$light:         body-mix(65%) !default;
+$dark:          body-mix(95%) !default;
 
 $min-contrast-ratio:   1.9 !default;
 
-// Body
-
-$body-bg:                   $gray-900 !default;
-$body-color:                $white !default;
-
 // Links
 
 $link-color:                $success !default;
@@ -57,27 +63,27 @@ $font-family-sans-serif:      Lato, -apple-system, BlinkMacSystemFont, "Segoe UI
 $h1-font-size:                3rem !default;
 $h2-font-size:                2.5rem !default;
 $h3-font-size:                2rem !default;
-$text-muted:                  $gray-600 !default;
+$text-muted:                  body-mix(75%) !default;
 
 // Tables
 
-$table-border-color:          $gray-700 !default;
+$table-border-color:          body-mix(85%) !default;
 
 $table-bg-scale:              0% !default;
 
 // Forms
 
-$input-bg:                          $white !default;
-$input-color:                       $gray-800 !default;
+$input-bg:                          $body-color !default;
+$input-color:                       body-mix(95%) !default;
 $input-border-color:                $body-bg !default;
-$input-group-addon-color:           $gray-500 !default;
-$input-group-addon-bg:              $gray-700 !default;
-$input-placeholder-color:           $gray-600 !default;
+$input-group-addon-color:           body-mix(65%) !default;
+$input-group-addon-bg:              body-mix(85%) !default;
+$input-placeholder-color:           body-mix(75%) !default;
 
-$form-check-input-bg:                     $white !default;
+$form-check-input-bg:                     $body-color !default;
 $form-check-input-border:                 none !default;
 
-$form-select-disabled-color:        $gray-600 !default;
+$form-select-disabled-color:        body-mix(75%) !default;
 
 $form-file-button-color:          $input-group-addon-color !default;
 $form-file-button-bg:             $input-group-addon-bg !default;
@@ -85,91 +91,91 @@ $form-file-button-hover-bg:       darken($form-file-button-bg, 5%) !default;
 
 // Dropdowns
 
-$dropdown-bg:                       $gray-900 !default;
-$dropdown-border-color:             $gray-700 !default;
-$dropdown-divider-bg:               $gray-700 !default;
-$dropdown-link-color:               $white !default;
-$dropdown-link-hover-color:         $white !default;
+$dropdown-bg:                       $body-bg !default;
+$dropdown-border-color:             body-mix(85%) !default;
+$dropdown-divider-bg:               body-mix(85%) !default;
+$dropdown-link-color:               $body-color !default;
+$dropdown-link-hover-color:         $body-color !default;
 $dropdown-link-hover-bg:            $primary !default;
 
 // Navs
 
 $nav-link-padding-x:                2rem !default;
-$nav-link-disabled-color:           $gray-500 !default;
-$nav-tabs-border-color:             $gray-700 !default;
+$nav-link-disabled-color:           body-mix(65%) !default;
+$nav-tabs-border-color:             body-mix(85%) !default;
 $nav-tabs-link-hover-border-color:  $nav-tabs-border-color $nav-tabs-border-color transparent !default;
-$nav-tabs-link-active-color:        $white !default;
+$nav-tabs-link-active-color:        $body-color !default;
 $nav-tabs-link-active-border-color: $nav-tabs-border-color $nav-tabs-border-color transparent !default;
 
 // Navbar
 
 $navbar-padding-y:                  1rem !default;
-$navbar-dark-color:                rgba($white, .6) !default;
-$navbar-dark-hover-color:          $white !default;
-$navbar-light-color:                rgba($gray-900, .7) !default;
-$navbar-light-hover-color:          $gray-900 !default;
-$navbar-light-active-color:         $gray-900 !default;
-$navbar-light-toggler-border-color: rgba($gray-900, .1) !default;
+$navbar-dark-color:                rgba($body-color, .6) !default;
+$navbar-dark-hover-color:          $body-color !default;
+$navbar-light-color:                rgba($body-bg, .7) !default;
+$navbar-light-hover-color:          $body-bg !default;
+$navbar-light-active-color:         $body-bg !default;
+$navbar-light-toggler-border-color: rgba($body-bg, .1) !default;
 
 // Pagination
 
-$pagination-color:                  $white !default;
+$pagination-color:                  $body-color !default;
 $pagination-bg:                     $success !default;
 $pagination-border-width:           0 !default;
 $pagination-border-color:           transparent !default;
-$pagination-hover-color:            $white !default;
+$pagination-hover-color:            $body-color !default;
 $pagination-hover-bg:               lighten($success, 10%) !default;
 $pagination-hover-border-color:     transparent !default;
 $pagination-active-bg:              $pagination-hover-bg !default;
 $pagination-active-border-color:    transparent !default;
-$pagination-disabled-color:         $white !default;
+$pagination-disabled-color:         $body-color !default;
 $pagination-disabled-bg:            darken($success, 15%) !default;
 $pagination-disabled-border-color:  transparent !default;
 
 // Cards
 
-$card-cap-bg:                       $gray-700 !default;
-$card-bg:                           $gray-800 !default;
+$card-cap-bg:                       body-mix(85%) !default;
+$card-bg:                           body-mix(95%) !default;
 
 // Popovers
 
-$popover-bg:                        $gray-800 !default;
-$popover-header-bg:                 $gray-700 !default;
+$popover-bg:                        body-mix(95%) !default;
+$popover-header-bg:                 body-mix(85%) !default;
 
 // Toasts
 
-$toast-background-color:            $gray-700 !default;
-$toast-header-background-color:     $gray-800 !default;
+$toast-background-color:            body-mix(85%) !default;
+$toast-header-background-color:     body-mix(95%) !default;
 
 // Modals
 
-$modal-content-bg:                  $gray-800 !default;
-$modal-content-border-color:        $gray-700 !default;
-$modal-header-border-color:         $gray-700 !default;
+$modal-content-bg:                  body-mix(95%) !default;
+$modal-content-border-color:        body-mix(85%) !default;
+$modal-header-border-color:         body-mix(85%) !default;
 
 // Progress bars
 
-$progress-bg:                       $gray-700 !default;
+$progress-bg:                       body-mix(85%) !default;
 
 // List group
 
 $list-group-color:                  $body-color !default;
-$list-group-bg:                     $gray-800 !default;
-$list-group-border-color:           $gray-700 !default;
-$list-group-hover-bg:               $gray-700 !default;
+$list-group-bg:                     body-mix(95%) !default;
+$list-group-border-color:           body-mix(85%) !default;
+$list-group-hover-bg:               body-mix(85%) !default;
 $list-group-action-hover-color:     $list-group-color !default;
-$list-group-action-active-bg:       $gray-900 !default;
+$list-group-action-active-bg:       $body-bg !default;
 
 // Breadcrumbs
 
 $breadcrumb-padding-y:              .375rem !default;
 $breadcrumb-padding-x:              .75rem !default;
-$breadcrumb-bg:                     $gray-700 !default;
+$breadcrumb-bg:                     body-mix(85%) !default;
 $breadcrumb-border-radius:          .25rem !default;
 
 // Close
 
-$btn-close-color:            $white !default;
+$btn-close-color:            $body-color !default;
 $btn-close-opacity:          .4 !default;
 $btn-close-hover-opacity:    1 !default;