File: 006-bootswatch-materia-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 (205 lines) | stat: -rw-r--r-- 6,296 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
diff --git a/inst/lib/bsw5/dist/materia/_bootswatch.scss b/inst/lib/bsw5/dist/materia/_bootswatch.scss
index 7be444f7..40575cb4 100644
--- a/inst/lib/bsw5/dist/materia/_bootswatch.scss
+++ b/inst/lib/bsw5/dist/materia/_bootswatch.scss
@@ -50,7 +50,7 @@ $web-font-path: "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;50
   .btn-#{$class} {
     &:focus {
       background-color: $bg;
-      box-shadow: 0 0 0 2px rgba(204, 204, 204, .5);
+      box-shadow: $btn-focus-box-shadow;
     }
 
     &:hover,
@@ -59,7 +59,7 @@ $web-font-path: "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;50
     }
 
     &:active {
-      box-shadow: 2px 2px 4px rgba(0, 0, 0, .4);
+      box-shadow: $btn-active-box-shadow;
     }
 
     @include ripple($color);
@@ -81,7 +81,7 @@ $web-font-path: "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;50
 
 .navbar {
   border: none;
-  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
+  box-shadow: 0 1px 2px rgba($black, .3);
 
   &-brand {
     font-size: 24px;
@@ -101,14 +101,14 @@ $web-font-path: "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;50
     input[type="number"],
     input[type="tel"] {
       color: $white;
-      box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .5);
+      box-shadow: inset 0 -1px 0 rgba($white, .5);
 
       &:focus {
         box-shadow: inset 0 -2px 0 $white;
       }
 
       &::placeholder {
-        color: rgba(255, 255, 255, .5);
+        color: rgba($white, .5);
       }
     }
   }
@@ -128,7 +128,7 @@ $web-font-path: "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;50
 .btn {
   text-transform: uppercase;
   border: none;
-  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
+  box-shadow: $btn-box-shadow;
   transition: color .4s, background-color .4s, border-color .4s, box-shadow .4s;
 
   &-link {
@@ -161,13 +161,13 @@ $web-font-path: "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;50
     &.disabled,
     &[disabled],
     fieldset[disabled] & {
-      color: rgba(0, 0, 0, .4);
-      background-color: rgba(0, 0, 0, .1);
+      color: rgba($black, .4);
+      background-color: rgba($black, .1);
       opacity: 1;
 
       &:hover,
       &:focus {
-        background-color: rgba(0, 0, 0, .1);
+        background-color: rgba($black, .1);
       }
     }
   }
@@ -201,12 +201,12 @@ $web-font-path: "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;50
 
   .btn + .btn,
   .btn + .btn-group > .dropdown-toggle {
-    box-shadow: 1px 1px 4px rgba(0, 0, 0, .4);
+    box-shadow: 1px 1px 4px rgba($black, .4);
   }
 }
 
 .border-secondary {
-  border: 1px solid #dfdfdf !important;
+  border: 1px solid mix($white, $black, 86.7%) !important;
 }
 
 // Typography
@@ -266,22 +266,22 @@ input[type="number"],
 [type="email"].form-control,
 [type="tel"].form-control,
 [contenteditable].form-control {
-  box-shadow: inset 0 -1px 0 #ddd;
+  box-shadow: $input-box-shadow;
   transition: box-shadow .2s;
 
   &:focus {
-    box-shadow: inset 0 -2px 0 $primary;
+    box-shadow: $input-focus-box-shadow;
   }
 
   &[disabled],
   &[readonly] {
-    border-bottom: 1px dotted #ddd;
+    border-bottom: 1px dotted mix($white, $black, 86.7%);
     box-shadow: none;
   }
 
   &[disabled],
   &[disabled]::placeholder {
-    color: #ddd;
+    color: mix($white, $black, 86.7%);
   }
 }
 
@@ -297,7 +297,7 @@ select.form-control {
   background-repeat: no-repeat;
   background-position: right center;
   background-size: 8px 4px;
-  box-shadow: inset 0 -1px 0 #ddd;
+  box-shadow: $input-box-shadow;
 
   &.input {
     &-sm {
@@ -311,7 +311,7 @@ select.form-control {
 
   &:focus {
     background-image: escape-svg(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 4'><path fill='#{$gray-900}' d='M8 0 4 4 0 0z'/></svg>"));
-    box-shadow: inset 0 -2px 0 $primary;
+    box-shadow: $input-focus-box-shadow;
   }
 
   &[multiple] {
@@ -353,7 +353,7 @@ select.form-control {
       content: "";
       background-color: $white;
       border-radius: 50%;
-      box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
+      box-shadow: 0 1px 4px rgba($black, .3);
       transition: left .15s ease-in-out;
     }
 
@@ -366,7 +366,7 @@ select.form-control {
       height: 1.2em;
       content: "";
       border-radius: 50%;
-      box-shadow: 0 0 0 9px rgba(0, 0, 0, .05);
+      box-shadow: 0 0 0 9px rgba($black, .05);
       transition: left .15s ease-in-out, transform .15s ease-in-out, box-shadow .15s ease-in-out;
       transform: scale(0);
     }
@@ -381,21 +381,21 @@ select.form-control {
 
     &:focus:not(.disabled) {
       &::after {
-        box-shadow: 0 0 0 9px rgba(0, 0, 0, .1);
+        box-shadow: 0 0 0 9px rgba($black, .1);
       }
     }
 
     &:checked {
-      background-color: rgba(33, 150, 243, .3);
+      background-color: rgba($primary, .3);
 
       &::before {
         left: calc(100% - .8em);
-        background-color: rgba(33, 150, 243, 1);
+        background-color: rgba($primary, 1);
       }
 
       &::after {
         left: calc(100% - .8em);
-        box-shadow: 0 0 0 9px rgba(33, 150, 243, .1);
+        box-shadow: 0 0 0 9px rgba($primary, .1);
       }
 
       &:hover:not(.disabled),
@@ -407,7 +407,7 @@ select.form-control {
 
       &:focus:not(.disabled) {
         &::after {
-          box-shadow: 0 0 0 9px rgba(33, 150, 243, .2);
+          box-shadow: 0 0 0 9px rgba($primary, .2);
         }
       }
     }
diff --git a/inst/lib/bsw5/dist/materia/_variables.scss b/inst/lib/bsw5/dist/materia/_variables.scss
index 9baf520c..fb954e11 100755
--- a/inst/lib/bsw5/dist/materia/_variables.scss
+++ b/inst/lib/bsw5/dist/materia/_variables.scss
@@ -112,3 +112,12 @@ $progress-border-radius:        0 !default;
 $btn-close-color:            $white !default;
 $btn-close-opacity:          .6 !default;
 $btn-close-hover-opacity:    1 !default;
+
+
+// Box shadows
+$enable-shadows: true !default;
+$btn-box-shadow: 0 1px 4px mix($white, $black, 60%) !default;
+$btn-active-box-shadow: 2px 2px 4px mix($white, $black, 60%) !default;
+$btn-focus-box-shadow: 0 0 0 2px mix($white, $black, 40%) !default;
+$input-box-shadow: inset 0 -1px 0 mix($white, $black, 86.7%) !default;
+$input-focus-box-shadow: inset 0 -2px 0 $primary  !default;
\ No newline at end of file