浏览代码

Dark mode design improvements (#2232)

* Modify highlight/link color

* Paler dashed outline

* Simpler input focus

* Tweak statuses' gray

* Tweak & fix :focus colors

* Swap TabBtn hover/focus colors

* Tweak dark focus outline

* Darker actionBtn

* Webcam button support

* Add isDraggingOver support

* Add ScreenCapture support

* ProviderBrowserItem-inner support

* Better fakeCheckbox support
Alexander Zaytsev 5 年之前
父节点
当前提交
57da3a5a80

+ 4 - 5
packages/@uppy/core/src/_common.scss

@@ -117,7 +117,8 @@
   }
   }
 
 
   [data-uppy-theme="dark"] &:focus {
   [data-uppy-theme="dark"] &:focus {
-    border-color: $gray-300;
+    border-color: $gray-700;
+    box-shadow: none;
   }
   }
 }
 }
 
 
@@ -167,10 +168,7 @@
 
 
   [data-uppy-theme="dark"] & {
   [data-uppy-theme="dark"] & {
     color: $gray-200;
     color: $gray-200;
-  }
-
-  [data-uppy-theme="dark"] &:focus {
-    box-shadow: 0 0 0 3px rgba($blue, 0.6);
+    @include blue-border-focus--dark;
   }
   }
 }
 }
 
 
@@ -197,6 +195,7 @@
 
 
   [data-uppy-theme="dark"] & {
   [data-uppy-theme="dark"] & {
     color: $gray-200;
     color: $gray-200;
+    @include blue-border-focus--dark;
   }
   }
 
 
   [data-uppy-theme="dark"] &:hover {
   [data-uppy-theme="dark"] &:hover {

+ 8 - 0
packages/@uppy/core/src/_utils.scss

@@ -48,6 +48,14 @@
   }
   }
 }
 }
 
 
+@mixin blue-border-focus--dark() {
+  @include clear-focus();
+
+  &:focus {
+    box-shadow: 0 0 0 2px rgba($lightblue, 0.85);
+  }
+}
+
 @mixin clear-focus() {
 @mixin clear-focus() {
   &:focus {
   &:focus {
     outline: none;
     outline: none;

+ 3 - 1
packages/@uppy/core/src/_variables.scss

@@ -10,7 +10,9 @@ $pomegranate: #ff4b23 !default;
 $orange: #f6a623 !default;
 $orange: #f6a623 !default;
 $yellow: #ffd600 !default;
 $yellow: #ffd600 !default;
 $green: #1bb240 !default;
 $green: #1bb240 !default;
+$darkgreen: #1c8b37 !default;
 $blue: #2275d7 !default;
 $blue: #2275d7 !default;
+$lightblue: #aae1ff !default;
 
 
 $gray-50: #fafafa !default;
 $gray-50: #fafafa !default;
 $gray-100: #f4f4f4 !default;
 $gray-100: #f4f4f4 !default;
@@ -26,7 +28,7 @@ $gray-800: #333 !default;
 $gray-900: #1f1f1f !default;
 $gray-900: #1f1f1f !default;
 
 
 $highlight: #eceef2;
 $highlight: #eceef2;
-$highlight--dark: #0DB4CE;
+$highlight--dark: #02baf2;
 
 
 $uppy-pink: #eb2177;
 $uppy-pink: #eb2177;
 
 

+ 1 - 0
packages/@uppy/dashboard/src/components/FileItem/Buttons/index.scss

@@ -10,6 +10,7 @@
   }
   }
 
 
   [data-uppy-theme="dark"] & {
   [data-uppy-theme="dark"] & {
+    @include blue-border-focus--dark;
     color: $gray-300;
     color: $gray-300;
   }
   }
 
 

+ 1 - 1
packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.scss

@@ -24,7 +24,7 @@
     color: $gray-600;
     color: $gray-600;
 
 
     [data-uppy-theme="dark"] & {
     [data-uppy-theme="dark"] & {
-      color: $gray-300;
+      color: $gray-400;
     }
     }
   }
   }
     .uppy-DashboardItem-statusSize {
     .uppy-DashboardItem-statusSize {

+ 6 - 2
packages/@uppy/dashboard/src/components/FileItem/FilePreviewAndLink/index.scss

@@ -31,11 +31,15 @@
     position: absolute;
     position: absolute;
     left: 0; right: 0;
     left: 0; right: 0;
     top: 0; bottom: 0;
     top: 0; bottom: 0;
-
     z-index: $zIndex-3;
     z-index: $zIndex-3;
-    &:focus{
+
+    &:focus {
       box-shadow: inset 0 0 0 3px lighten($blue, 20%);
       box-shadow: inset 0 0 0 3px lighten($blue, 20%);
     }
     }
+
+    [data-uppy-theme="dark"] &:focus {
+      box-shadow: inset 0 0 0 3px darken($highlight--dark, 20%);
+    }
   }
   }
 
 
   .uppy-DashboardItem-preview img.uppy-DashboardItem-previewImg {
   .uppy-DashboardItem-preview img.uppy-DashboardItem-previewImg {

+ 13 - 3
packages/@uppy/dashboard/src/style.scss

@@ -217,6 +217,10 @@
   .uppy-Dashboard--modal & {
   .uppy-Dashboard--modal & {
     border-color: $gray-300;
     border-color: $gray-300;
   }
   }
+
+  [data-uppy-theme="dark"] & {
+    border-color: $gray-600;
+  }
 }
 }
 
 
 .uppy-Dashboard-AddFiles-info {
 .uppy-Dashboard-AddFiles-info {
@@ -360,7 +364,7 @@
     background-color: $gray-100--highlighted;
     background-color: $gray-100--highlighted;
 
 
     [data-uppy-theme="dark"] & {
     [data-uppy-theme="dark"] & {
-      background-color: $gray-700;
+      background-color: $gray-800;
     }
     }
   }
   }
 
 
@@ -369,7 +373,7 @@
     background-color: $highlight;
     background-color: $highlight;
 
 
     [data-uppy-theme="dark"] & {
     [data-uppy-theme="dark"] & {
-      background-color: $gray-800;
+      background-color: $gray-700;
     }
     }
   }
   }
 
 
@@ -638,8 +642,14 @@
   background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 1v1C11.85 2 2 11.85 2 24s9.85 22 22 22 22-9.85 22-22S36.15 2 24 2V1zm0 0V0c13.254 0 24 10.746 24 24S37.254 48 24 48 0 37.254 0 24 10.746 0 24 0v1zm7.707 19.293a.999.999 0 1 1-1.414 1.414L25 16.414V34a1 1 0 1 1-2 0V16.414l-5.293 5.293a.999.999 0 1 1-1.414-1.414l7-7a.999.999 0 0 1 1.414 0l7 7z' fill='%232275D7' fill-rule='nonzero'/%3E%3C/svg%3E");
   background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 1v1C11.85 2 2 11.85 2 24s9.85 22 22 22 22-9.85 22-22S36.15 2 24 2V1zm0 0V0c13.254 0 24 10.746 24 24S37.254 48 24 48 0 37.254 0 24 10.746 0 24 0v1zm7.707 19.293a.999.999 0 1 1-1.414 1.414L25 16.414V34a1 1 0 1 1-2 0V16.414l-5.293 5.293a.999.999 0 1 1-1.414-1.414l7-7a.999.999 0 0 1 1.414 0l7 7z' fill='%232275D7' fill-rule='nonzero'/%3E%3C/svg%3E");
   background-position: 50% 50%;
   background-position: 50% 50%;
   background-repeat: no-repeat;
   background-repeat: no-repeat;
-  color: #707070;
+  color: $gray-600;
   font-size: 16px;
   font-size: 16px;
+
+  [data-uppy-theme="dark"] & {
+    color: $gray-400;
+    border-color: $highlight--dark;
+    background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 1v1C11.85 2 2 11.85 2 24s9.85 22 22 22 22-9.85 22-22S36.15 2 24 2V1zm0 0V0c13.254 0 24 10.746 24 24S37.254 48 24 48 0 37.254 0 24 10.746 0 24 0v1zm7.707 19.293a.999.999 0 1 1-1.414 1.414L25 16.414V34a1 1 0 1 1-2 0V16.414l-5.293 5.293a.999.999 0 1 1-1.414-1.414l7-7a.999.999 0 0 1 1.414 0l7 7z' fill='%2302BAF2' fill-rule='nonzero'/%3E%3C/svg%3E");
+  }
 }
 }
 
 
 .uppy-Dashboard.uppy-Dashboard--isDraggingOver {
 .uppy-Dashboard.uppy-Dashboard--isDraggingOver {

+ 4 - 0
packages/@uppy/provider-views/src/style.scss

@@ -97,6 +97,10 @@
       text-decoration: underline;
       text-decoration: underline;
       cursor: pointer;
       cursor: pointer;
     }
     }
+
+    [data-uppy-theme="dark"] & {
+      color: $gray-200;
+    }
   }
   }
 // ...uppy-Provider-breadcrumbs|
 // ...uppy-Provider-breadcrumbs|
 
 

+ 4 - 0
packages/@uppy/provider-views/src/style/uppy-ProviderBrowser-viewType--grid.scss

@@ -78,6 +78,10 @@
       box-shadow: 0 0 0 3px rgba($blue, 0.9);
       box-shadow: 0 0 0 3px rgba($blue, 0.9);
     }
     }
 
 
+    [data-uppy-theme="dark"] & {
+      box-shadow: 0 0 0 3px rgba($lightblue, 0.7);
+    }
+
     img {
     img {
       width: 100%;
       width: 100%;
       height: 100%;
       height: 100%;

+ 5 - 0
packages/@uppy/provider-views/src/style/uppy-ProviderBrowser-viewType--list.scss

@@ -41,6 +41,11 @@
       height: 5px; width: 9px;
       height: 5px; width: 9px;
       left: 3px; top: 4px;
       left: 3px; top: 4px;
     }
     }
+
+    [data-uppy-theme="dark"] &:focus {
+      border-color: rgba($highlight--dark, 0.7);
+      box-shadow: 0 0 0 3px rgba($highlight--dark, 0.2);
+    }
   }
   }
   // Checked: color the background, show the checkmark
   // Checked: color the background, show the checkmark
   .uppy-ProviderBrowserItem-fakeCheckbox--is-checked {
   .uppy-ProviderBrowserItem-fakeCheckbox--is-checked {

+ 8 - 1
packages/@uppy/provider-views/src/style/uppy-ProviderBrowserItem-fakeCheckbox.scss

@@ -14,6 +14,13 @@
   }
   }
 
 
   [data-uppy-theme="dark"] & {
   [data-uppy-theme="dark"] & {
-    background-color: $gray-700;
+    background-color: $gray-900;
+    border-color: $gray-500;
+  }
+}
+
+.uppy-ProviderBrowserItem-fakeCheckbox--is-checked {
+  [data-uppy-theme="dark"] & {
+    background-color: $gray-800;
   }
   }
 }
 }

+ 10 - 5
packages/@uppy/screen-capture/src/style.scss

@@ -45,9 +45,15 @@
   justify-content: center;
   justify-content: center;
   padding: 0 20px;
   padding: 0 20px;
   background-color: $white;
   background-color: $white;
+
+  [data-uppy-theme="dark"] & {
+    background-color: $gray-900;
+    border-top: 1px solid $gray-800;
+  }
 }
 }
 
 
 .uppy-ScreenCapture-button {
 .uppy-ScreenCapture-button {
+  @include blue-border-focus;
   width: 45px;
   width: 45px;
   height: 45px;
   height: 45px;
   border-radius: 50%;
   border-radius: 50%;
@@ -55,6 +61,10 @@
   cursor: pointer;
   cursor: pointer;
   transition: all 0.3s;
   transition: all 0.3s;
 
 
+  [data-uppy-theme="dark"] & {
+    @include blue-border-focus--dark;
+  }
+
   .uppy-size--md & {
   .uppy-size--md & {
     width: 60px;
     width: 60px;
     height: 60px;
     height: 60px;
@@ -63,11 +73,6 @@
   &:hover {
   &:hover {
     background-color: darken($red, 5%);
     background-color: darken($red, 5%);
   }
   }
-
-  &:focus {
-    outline: none;
-    box-shadow: 0 0 0 0.2rem rgba($blue, 0.5);
-  }
 }
 }
 
 
 .uppy-ScreenCapture-button svg {
 .uppy-ScreenCapture-button svg {

+ 26 - 7
packages/@uppy/status-bar/src/style.scss

@@ -152,7 +152,7 @@
   white-space: nowrap;
   white-space: nowrap;
 
 
   [data-uppy-theme="dark"] & {
   [data-uppy-theme="dark"] & {
-    color: $gray-300;
+    color: $gray-400;
   }
   }
 }
 }
 
 
@@ -210,6 +210,10 @@
   margin: 3px;
   margin: 3px;
   opacity: 0.9;
   opacity: 0.9;
 
 
+  [data-uppy-theme="dark"] & {
+    @include blue-border-focus--dark;
+  }
+
   &:hover {
   &:hover {
     opacity: 1;
     opacity: 1;
   }
   }
@@ -249,6 +253,10 @@
     padding: 1px 6px 3px 18px;
     padding: 1px 6px 3px 18px;
     position: relative;
     position: relative;
 
 
+    [data-uppy-theme="dark"] & {
+      @include blue-border-focus--dark;
+    }
+
     &:hover {
     &:hover {
       background-color: darken($pomegranate, 8%);
       background-color: darken($pomegranate, 8%);
     }
     }
@@ -267,16 +275,23 @@
     color: $white;
     color: $white;
     background-color: $green;
     background-color: $green;
     line-height: 1;
     line-height: 1;
-  }
+    
+    &:hover {
+      background-color: darken($green, 5%);
+    }
 
 
-    .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload:hover {
-      background-color: darken($green, 10%);
+    [data-uppy-theme="dark"] & {
+      background-color: $darkgreen;
     }
     }
 
 
-    .uppy-size--md .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload {
-      padding: 13px 22px;
-      width: auto;
+    [data-uppy-theme="dark"] &:hover {
+      background-color: darken($darkgreen, 5%);
     }
     }
+  }
+  .uppy-size--md .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload {
+    padding: 13px 22px;
+    width: auto;
+  }
 
 
   .uppy-StatusBar:not(.is-waiting) .uppy-StatusBar-actionBtn--upload {
   .uppy-StatusBar:not(.is-waiting) .uppy-StatusBar-actionBtn--upload {
     background-color: transparent;
     background-color: transparent;
@@ -291,6 +306,10 @@
     padding-left: 3px;
     padding-left: 3px;
     padding-bottom: 1px;
     padding-bottom: 1px;
     border-radius: 3px;
     border-radius: 3px;
+
+    [data-uppy-theme="dark"] & {
+      @include blue-border-focus--dark;
+    }
   }
   }
 
 
 .uppy-StatusBar-details {
 .uppy-StatusBar-details {

+ 5 - 5
packages/@uppy/webcam/src/style.scss

@@ -46,6 +46,7 @@
 }
 }
 
 
 .uppy-Webcam-button {
 .uppy-Webcam-button {
+  @include blue-border-focus;
   width: 45px;
   width: 45px;
   height: 45px;
   height: 45px;
   border-radius: 50%;
   border-radius: 50%;
@@ -53,6 +54,10 @@
   color: $white;
   color: $white;
   cursor: pointer;
   cursor: pointer;
   transition: all 0.3s;
   transition: all 0.3s;
+
+  [data-uppy-theme="dark"] & {
+    @include blue-border-focus--dark;
+  }
 }
 }
 
 
   .uppy-Webcam-button svg {
   .uppy-Webcam-button svg {
@@ -75,11 +80,6 @@
     background-color: darken($red, 5%);
     background-color: darken($red, 5%);
   }
   }
 
 
-  .uppy-Webcam-button:focus {
-    outline: none;
-    box-shadow: 0 0 0 0.2rem rgba($blue, 0.5);
-  }
-
 .uppy-Webcam-button--picture {
 .uppy-Webcam-button--picture {
   margin-right: 12px;
   margin-right: 12px;
 }
 }