From 4a6c16df8da3904cc529b3675b526b574d5c06cc Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Sat, 11 Nov 2017 19:05:08 +0900 Subject: [PATCH 1/8] Add base of white theme --- browser/finder/ipcClient.js | 2 ++ browser/main/Main.js | 2 ++ browser/main/lib/ConfigManager.js | 2 ++ browser/main/modals/PreferencesModal/UiTab.js | 3 ++- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/browser/finder/ipcClient.js b/browser/finder/ipcClient.js index 6a5fb929..c3d5ab6f 100644 --- a/browser/finder/ipcClient.js +++ b/browser/finder/ipcClient.js @@ -84,6 +84,8 @@ nodeIpc.connectTo( const { config } = payload if (config.ui.theme === 'dark') { document.body.setAttribute('data-theme', 'dark') + } else if (config.ui.theme === 'white') { + document.body.setAttribute('data-theme', 'white') } else { document.body.setAttribute('data-theme', 'default') } diff --git a/browser/main/Main.js b/browser/main/Main.js index bfd1bd5f..c8795a7d 100644 --- a/browser/main/Main.js +++ b/browser/main/Main.js @@ -57,6 +57,8 @@ class Main extends React.Component { if (config.ui.theme === 'dark') { document.body.setAttribute('data-theme', 'dark') + } else if (config.ui.theme === 'white') { + document.body.setAttribute('data-theme', 'white') } else { document.body.setAttribute('data-theme', 'default') } diff --git a/browser/main/lib/ConfigManager.js b/browser/main/lib/ConfigManager.js index fd374cf1..48cdd64f 100644 --- a/browser/main/lib/ConfigManager.js +++ b/browser/main/lib/ConfigManager.js @@ -106,6 +106,8 @@ function set (updates) { if (newConfig.ui.theme === 'dark') { document.body.setAttribute('data-theme', 'dark') + } else if (newConfig.ui.theme === 'white') { + document.body.setAttribute('data-theme', 'white') } else { document.body.setAttribute('data-theme', 'default') } diff --git a/browser/main/modals/PreferencesModal/UiTab.js b/browser/main/modals/PreferencesModal/UiTab.js index af120b94..8c1e8a4c 100644 --- a/browser/main/modals/PreferencesModal/UiTab.js +++ b/browser/main/modals/PreferencesModal/UiTab.js @@ -141,7 +141,8 @@ class UiTab extends React.Component { onChange={(e) => this.handleUIChange(e)} ref='uiTheme' > - + + From bb46a9ba4c9c522e1e2d2beee50a8fdeac143fe8 Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Sat, 11 Nov 2017 19:06:27 +0900 Subject: [PATCH 2/8] Change default color and add white theme --- browser/components/NavToggleButton.styl | 3 + browser/components/SideNavFilter.styl | 107 +++++++++++++++--------- browser/components/StorageItem.styl | 34 ++++++-- browser/main/SideNav/SideNav.styl | 51 ++++++++--- browser/main/SideNav/StorageItem.styl | 52 +++++++++--- browser/main/SideNav/index.js | 2 +- browser/styles/index.styl | 68 ++++++++++++--- 7 files changed, 234 insertions(+), 83 deletions(-) diff --git a/browser/components/NavToggleButton.styl b/browser/components/NavToggleButton.styl index dba4f66f..83a9853d 100644 --- a/browser/components/NavToggleButton.styl +++ b/browser/components/NavToggleButton.styl @@ -10,6 +10,9 @@ line-height 32px padding 0 +body[data-theme="white"] + navWhiteButtonColor() + body[data-theme="dark"] .navToggle &:hover diff --git a/browser/components/SideNavFilter.styl b/browser/components/SideNavFilter.styl index 388801dd..b35df903 100644 --- a/browser/components/SideNavFilter.styl +++ b/browser/components/SideNavFilter.styl @@ -9,6 +9,13 @@ width 100% text-align left overflow ellipsis + &:hover + color $ui-button-default-color + background-color alpha($ui-button-default--active-backgroundColor, 20%) + transition background-color 0.15s + &:active, &:active:hover + color $ui-button-default-color + background-color $ui-button-default--active-backgroundColor .counters float right @@ -17,53 +24,17 @@ .menu-button--active @extend .menu-button color #e74c3c - background-color $ui-button--active-backgroundColor - .menu-button-label - color $ui-text-color - &:hover - background-color alpha($ui-button--active-backgroundColor, 50%) - color #e74c3c - .menu-button-label - color $ui-text-color - &:active, &:active:hover - background-color alpha($ui-button--active-backgroundColor, 50%) - color #e74c3c - .menu-button-label - color $ui-text-color + SideNavFilter() .menu-button-star--active @extend .menu-button color #F9BF3B - background-color $ui-button--active-backgroundColor - .menu-button-label - color $ui-text-color - &:hover - background-color alpha($ui-button--active-backgroundColor, 50%) - color #F9BF3B - .menu-button-label - color $ui-text-color - &:active, &:active:hover - background-color alpha($ui-button--active-backgroundColor, 50%) - color #F9BF3B - .menu-button-label - color $ui-text-color + SideNavFilter() .menu-button-trash--active @extend .menu-button color #5D9E36 - background-color $ui-button--active-backgroundColor - .menu-button-label - color $ui-text-color - &:hover - background-color alpha($ui-button--active-backgroundColor, 50%) - color #5D9E36 - .menu-button-label - color $ui-text-color - &:active, &:active:hover - background-color alpha($ui-button--active-backgroundColor, 50%) - color #5D9E36 - .menu-button-label - color $ui-text-color + SideNavFilter() .menu-button-label margin-left 5px @@ -94,6 +65,64 @@ opacity 0 font-size 13px +body[data-theme="white"] + .menu-button + navWhiteButtonColor() + + .counters + color $ui-inactive-text-color + + .menu-button--active + @extend .menu-button + color #e74c3c + background-color $ui-button--active-backgroundColor + .menu-button-label + color $ui-text-color + &:hover + background-color alpha($ui-button--active-backgroundColor, 50%) + color #e74c3c + .menu-button-label + color $ui-text-color + &:active, &:active:hover + background-color alpha($ui-button--active-backgroundColor, 50%) + color #e74c3c + .menu-button-label + color $ui-text-color + + .menu-button-star--active + @extend .menu-button + color #F9BF3B + background-color $ui-button--active-backgroundColor + .menu-button-label + color $ui-text-color + &:hover + background-color alpha($ui-button--active-backgroundColor, 50%) + color #F9BF3B + .menu-button-label + color $ui-text-color + &:active, &:active:hover + background-color alpha($ui-button--active-backgroundColor, 50%) + color #F9BF3B + .menu-button-label + color $ui-text-color + + .menu-button-trash--active + @extend .menu-button + color #5D9E36 + background-color $ui-button--active-backgroundColor + .menu-button-label + color $ui-text-color + &:hover + background-color alpha($ui-button--active-backgroundColor, 50%) + color #5D9E36 + .menu-button-label + color $ui-text-color + &:active, &:active:hover + background-color alpha($ui-button--active-backgroundColor, 50%) + color #5D9E36 + .menu-button-label + color $ui-text-color + body[data-theme="dark"] .menu-button &:active diff --git a/browser/components/StorageItem.styl b/browser/components/StorageItem.styl index e5eb1e1f..030a3b06 100644 --- a/browser/components/StorageItem.styl +++ b/browser/components/StorageItem.styl @@ -17,20 +17,20 @@ &:first-child margin-top 0 &:hover - color $ui-text-color - background-color alpha($ui-button--active-backgroundColor, 20%) + color $ui-button-default-color + background-color alpha($ui-button-default--active-backgroundColor, 20%) transition background-color 0.15s &:active - color $ui-text-color - background-color $ui-button--active-backgroundColor + color $$ui-button-default-color + background-color $ui-button-default--active-backgroundColor .folderList-item--active @extend .folderList-item - color $ui-text-color - background-color $ui-button--active-backgroundColor + color $ui-button-default-color + background-color $ui-button-default--active-backgroundColor &:hover - color $ui-text-color - background-color alpha($ui-button--active-backgroundColor, 50%) + color $ui-button-default-color + background-color alpha($ui-button-default--active-backgroundColor, 50%) .folderList-item-name display block @@ -71,6 +71,24 @@ @extend .folderList-item-name padding-left 12px +body[data-theme="white"] + .folderList-item + color $ui-inactive-text-color + &:hover + color $ui-text-color + background-color alpha($ui-button--active-backgroundColor, 20%) + transition background-color 0.15s + &:active + color $ui-text-color + background-color $ui-button--active-backgroundColor + + .folderList-item--active + @extend .folderList-item + color $ui-text-color + background-color $ui-button--active-backgroundColor + &:hover + color $ui-text-color + background-color alpha($ui-button--active-backgroundColor, 50%) body[data-theme="dark"] .folderList-item diff --git a/browser/main/SideNav/SideNav.styl b/browser/main/SideNav/SideNav.styl index a3f0ffae..fa6f1b91 100644 --- a/browser/main/SideNav/SideNav.styl +++ b/browser/main/SideNav/SideNav.styl @@ -1,7 +1,7 @@ .root absolute top left bottom width $sideNav-width - background-color #f9f9f9 + background-color #2E3235 user-select none color $ui-text-color height: 100vh @@ -11,18 +11,19 @@ .top padding-bottom 15px -.top-menu +.top-menu-preference navButtonColor() position absolute top 22px - right 5px - height 23px + right 10px width 2em + background-color transparent &:hover - color $ui-text-color + color $ui-button-default--active-backgroundColor + background-color transparent &:active, &:active:hover - color $ui-text-color - background-color alpha($ui-button--active-backgroundColor, 20%) + color $ui-button-default--active-backgroundColor + background-color transparent .switch-buttons background-color transparent @@ -37,11 +38,11 @@ background-color transparent transition 0.2s &:hover - color alpha(#0B99F1, 60%) + color alpha(#239F86, 60%) .active-button @extend .non-active-button - color #0B99F1 + color $ui-button-default--active-backgroundColor .top-menu-label margin-left 5px @@ -88,7 +89,6 @@ opacity 0 margin-left 0 overflow hidden - background-color $ui-tooltip-backgroundColor z-index 10 color white line-height 30px @@ -97,6 +97,35 @@ pointer-events none font-size 13px +body[data-theme="white"] + .root, .root--folded + background-color #f9f9f9 + color $ui-text-color + + .top-menu-preference + navWhiteButtonColor() + &:hover + color #0B99F1 + &:active, &:active:hover + color #0B99F1 + + .non-active-button + color $ui-inactive-text-color + &:hover + color alpha(#0B99F1, 60%) + + .tag-title + p + color $ui-text-color + + .non-active-button + &:hover + color alpha(#0B99F1, 60%) + + .active-button + @extend .non-active-button + color #0B99F1 + body[data-theme="dark"] .root, .root--folded border-color $ui-dark-borderColor @@ -106,7 +135,7 @@ body[data-theme="dark"] .top border-color $ui-dark-borderColor - .top-menu + .top-menu-preference navDarkButtonColor() &:active background-color alpha($ui-dark-button--active-backgroundColor, 20%) diff --git a/browser/main/SideNav/StorageItem.styl b/browser/main/SideNav/StorageItem.styl index af3ff0ef..a0690120 100644 --- a/browser/main/SideNav/StorageItem.styl +++ b/browser/main/SideNav/StorageItem.styl @@ -12,20 +12,12 @@ .header--active margin-bottom 5px - background-color $ui-button--active-backgroundColor + background-color $ui-button-default--active-backgroundColor transition color background-color 0.15s - -.header--active .header-toggleButton - color $ui-text-color - -.header--active .header-info - color $ui-text-color - -.header--active .header-addFolderButton - color $ui-text-color + color $ui-button-default-color .header-toggleButton navButtonColor() @@ -38,7 +30,7 @@ border-radius 50% &:hover transition 0.2s - background-color alpha($ui-button--active-backgroundColor, 40%) + background-color alpha($ui-button-default--hover-backgroundColor, 40%) color $ui-text-color .header-info @@ -54,7 +46,14 @@ border none overflow ellipsis text-align left - background-color alpha($ui-button--active-backgroundColor, 20%) + background-color transparent + &:hover + color $ui-button-default-color + background-color alpha($ui-button-default--active-backgroundColor, 20%) + transition background-color 0.15s + &:active, &:active:hover + color $ui-button-default-color + background-color $ui-button-default--active-backgroundColor .header-info-path font-size 10px @@ -72,7 +71,7 @@ border-radius 50% &:hover transition 0.2s - background-color alpha($ui-button--active-backgroundColor, 40%) + background-color alpha($ui-button-default--hover-backgroundColor, 40%) color $ui-text-color .root--folded @@ -102,6 +101,33 @@ font-size 10px margin 0 5px +body[data-theme="white"] + .header--active + background-color $ui-button--active-backgroundColor + transition color background-color 0.15s + .header-toggleButton + color $ui-text-color + .header-info + color $ui-text-color + .header-addFolderButton + color $ui-text-color + + .header-toggleButton + navWhiteButtonColor() + &:hover + background-color alpha($ui-button--active-backgroundColor, 40%) + color $ui-text-color + + .header-info + navWhiteButtonColor() + background-color alpha($ui-button--active-backgroundColor, 20%) + + .header-addFolderButton + navWhiteButtonColor() + &:hover + background-color alpha($ui-button--active-backgroundColor, 40%) + color $ui-text-color + body[data-theme="dark"] .header--active background-color $ui-dark-button--active-backgroundColor diff --git a/browser/main/SideNav/index.js b/browser/main/SideNav/index.js index 336492d4..b1dad96c 100644 --- a/browser/main/SideNav/index.js +++ b/browser/main/SideNav/index.js @@ -165,7 +165,7 @@ class SideNav extends React.Component {
-