From a5080ed6b1ddf98a18c0bc01c29cd6eed5c86294 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Tue, 1 Dec 2015 13:25:12 -0500 Subject: Cleaned up styling for command and at mention suggestions --- web/react/components/at_mention_provider.jsx | 2 +- web/react/components/command_provider.jsx | 2 +- web/react/utils/utils.jsx | 12 +++---- web/sass-files/sass/partials/_command-box.scss | 39 ---------------------- web/sass-files/sass/partials/_mentions.scss | 1 - web/sass-files/sass/partials/_suggestion_list.scss | 24 +++++++++++++ web/sass-files/sass/styles.scss | 1 - 7 files changed, 32 insertions(+), 49 deletions(-) delete mode 100644 web/sass-files/sass/partials/_command-box.scss diff --git a/web/react/components/at_mention_provider.jsx b/web/react/components/at_mention_provider.jsx index 4d68fef9d..2feaad379 100644 --- a/web/react/components/at_mention_provider.jsx +++ b/web/react/components/at_mention_provider.jsx @@ -33,7 +33,7 @@ class AtMentionSuggestion extends React.Component { let className = 'mentions-name'; if (isSelection) { - className += ' mentions-focus'; + className += ' suggestion--selected'; } return ( diff --git a/web/react/components/command_provider.jsx b/web/react/components/command_provider.jsx index 0526e09b1..98a89cba0 100644 --- a/web/react/components/command_provider.jsx +++ b/web/react/components/command_provider.jsx @@ -12,7 +12,7 @@ class CommandSuggestion extends React.Component { let className = 'command-name'; if (isSelection) { - className += ' command--selected'; + className += ' suggestion--selected'; } return ( diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index d6ed34e70..135994b3c 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -597,7 +597,7 @@ export function applyTheme(theme) { } if (theme.centerChannelBg) { - changeCss('.app__content, .markdown__table, .markdown__table tbody tr, .command-box, .modal .modal-content, .mentions-name, .mentions--top .mentions-box', 'background:' + theme.centerChannelBg, 1); + changeCss('.app__content, .markdown__table, .markdown__table tbody tr, .suggestion-content, .modal .modal-content', 'background:' + theme.centerChannelBg, 1); changeCss('#post-list .post-list-holder-by-time', 'background:' + theme.centerChannelBg, 1); changeCss('#post-create', 'background:' + theme.centerChannelBg, 1); changeCss('.date-separator .separator__text, .new-separator .separator__text', 'background:' + theme.centerChannelBg, 1); @@ -615,9 +615,9 @@ export function applyTheme(theme) { changeCss('.sidebar--left, .sidebar--right .sidebar--right__header', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1); changeCss('.app__content, .post-create__container .post-create-body .btn-file, .post-create__container .post-create-footer .msg-typing, .command-name, .modal .modal-content, .dropdown-menu, .popover, .mentions-name, .tip-overlay', 'color:' + theme.centerChannelColor, 1); changeCss('#post-create', 'color:' + theme.centerChannelColor, 2); - changeCss('.mentions--top, .command-box', 'box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 3); - changeCss('.mentions--top, .command-box', '-webkit-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 2); - changeCss('.mentions--top, .command-box', '-moz-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 1); + changeCss('.mentions--top, .suggestion-list', 'box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 3); + changeCss('.mentions--top, .suggestion-list', '-webkit-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 2); + changeCss('.mentions--top, .suggestion-list', '-moz-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 1); changeCss('.dropdown-menu, .popover ', 'box-shadow:' + changeOpacity(theme.centerChannelColor, 0.1) + ' 0px 6px 12px', 3); changeCss('.dropdown-menu, .popover ', '-webkit-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.1) + ' 0px 6px 12px', 2); changeCss('.dropdown-menu, .popover ', '-moz-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.1) + ' 0px 6px 12px', 1); @@ -626,7 +626,7 @@ export function applyTheme(theme) { changeCss('.markdown__table tbody tr:nth-child(2n)', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1); changeCss('.channel-header__info>div.dropdown .header-dropdown__icon', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1); changeCss('.channel-header #member_popover', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1); - changeCss('.custom-textarea, .custom-textarea:focus, .preview-container .preview-div, .post-image__column .post-image__details, .sidebar--right .sidebar-right__body, .markdown__table th, .markdown__table td, .command-box, .modal .modal-content, .settings-modal .settings-table .settings-content .divider-light, .webhooks__container, .dropdown-menu, .modal .modal-header, .popover, .mentions--top .mentions-box', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1); + changeCss('.custom-textarea, .custom-textarea:focus, .preview-container .preview-div, .post-image__column .post-image__details, .sidebar--right .sidebar-right__body, .markdown__table th, .markdown__table td, .suggestion-content, .modal .modal-content, .settings-modal .settings-table .settings-content .divider-light, .webhooks__container, .dropdown-menu, .modal .modal-header, .popover', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1); changeCss('.popover.bottom>.arrow', 'border-bottom-color:' + changeOpacity(theme.centerChannelColor, 0.25), 1); changeCss('.search-help-popover .search-autocomplete__divider span', 'color:' + changeOpacity(theme.centerChannelColor, 0.7), 1); changeCss('.popover.right>.arrow', 'border-right-color:' + changeOpacity(theme.centerChannelColor, 0.25), 1); @@ -652,7 +652,7 @@ export function applyTheme(theme) { changeCss('@media(max-width: 1800px){.inner__wrap.move--left .post.post--comment.same--root', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.07), 2); changeCss('.post:hover, .modal .more-table tbody>tr:hover td, .settings-modal .settings-table .settings-content .section-min:hover', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1); changeCss('.date-separator.hovered--before:after, .date-separator.hovered--after:before, .new-separator.hovered--after:before, .new-separator.hovered--before:after', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1); - changeCss('.command-name:hover, .mentions-name:hover, .mentions-focus, .dropdown-menu>li>a:focus, .dropdown-menu>li>a:hover, .bot-indicator', 'background:' + changeOpacity(theme.centerChannelColor, 0.15), 1); + changeCss('.command-name:hover, .mentions-name:hover, .suggestion--selected, .dropdown-menu>li>a:focus, .dropdown-menu>li>a:hover, .bot-indicator', 'background:' + changeOpacity(theme.centerChannelColor, 0.15), 1); changeCss('code', 'background:' + changeOpacity(theme.centerChannelColor, 0.1), 1); changeCss('@media(min-width: 960px){.post.current--user:hover .post__body ', 'background: none;', 1); changeCss('.sidebar--right', 'color:' + theme.centerChannelColor, 2); diff --git a/web/sass-files/sass/partials/_command-box.scss b/web/sass-files/sass/partials/_command-box.scss deleted file mode 100644 index b5ba26edf..000000000 --- a/web/sass-files/sass/partials/_command-box.scss +++ /dev/null @@ -1,39 +0,0 @@ -.command-box { - position: absolute; - background-color: #fff; - width: 100%; - border: $border-gray; - bottom: 38px; - overflow: auto; - z-index: 100; - @extend %popover-box-shadow; - .sidebar--right & { - bottom: 100px; - } -} - -.command-name { - position: relative; - width: 100%; - line-height: 24px; - padding: 5px 10px 8px; - z-index: 101; - font-size: 0.95em; - border-bottom: 1px solid #ddd; - &:hover { - background-color: #e8eaed; - } - .command__desc { - margin-left: 5px; - @include opacity(0.5); - line-height: normal; - } -} - -.command-desc { - color: #a7a8ab; -} - -.command--selected { - background-color: #e8eaed; -} diff --git a/web/sass-files/sass/partials/_mentions.scss b/web/sass-files/sass/partials/_mentions.scss index a30490bd1..ee5b7f6d0 100644 --- a/web/sass-files/sass/partials/_mentions.scss +++ b/web/sass-files/sass/partials/_mentions.scss @@ -10,7 +10,6 @@ .mentions-name { position:relative; width:100%; - background-color:#fff; height:36px; padding:2px; z-index:101; diff --git a/web/sass-files/sass/partials/_suggestion_list.scss b/web/sass-files/sass/partials/_suggestion_list.scss index 7203779ed..c3df88964 100644 --- a/web/sass-files/sass/partials/_suggestion_list.scss +++ b/web/sass-files/sass/partials/_suggestion_list.scss @@ -21,3 +21,27 @@ position: absolute; bottom: 0; } + +.suggestion--selected { + // set by theme code +} + +.command-name { + position: relative; + width: 100%; + line-height: 24px; + padding: 5px 10px 8px; + z-index: 101; + font-size: 0.95em; + border-bottom: 1px solid #ddd; + + .command__desc { + margin-left: 5px; + @include opacity(0.5); + line-height: normal; + } +} + +.command-desc { + color: #a7a8ab; +} diff --git a/web/sass-files/sass/styles.scss b/web/sass-files/sass/styles.scss index a13496e23..e7fd7c976 100644 --- a/web/sass-files/sass/styles.scss +++ b/web/sass-files/sass/styles.scss @@ -32,7 +32,6 @@ @import "partials/modal"; @import "partials/forms"; @import "partials/mentions"; -@import "partials/command-box"; @import "partials/error"; @import "partials/error-bar"; @import "partials/loading"; -- cgit v1.2.3-1-g7c22