From 1e02ba111ae38ab758135b5b2b46f34c672ca02e Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 23 Sep 2017 14:47:32 +0200 Subject: Add emoji autosuggest (#5053) * Add emoji autosuggest Some credit goes to glitch-soc/mastodon#149 * Remove server-side shortcode->unicode conversion * Insert shortcode when suggestion is custom emoji * Remove remnant of server-side emojis * Update style of autosuggestions * Fix wrong emoji filenames generated in autosuggest item * Do not lazy load emoji picker, as that no longer works * Fix custom emoji autosuggest * Fix multiple "Custom" categories getting added to emoji index, only add once --- app/javascript/styles/components.scss | 45 +++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 20 deletions(-) (limited to 'app/javascript/styles/components.scss') diff --git a/app/javascript/styles/components.scss b/app/javascript/styles/components.scss index 595ab3658..755c9eb35 100644 --- a/app/javascript/styles/components.scss +++ b/app/javascript/styles/components.scss @@ -1880,15 +1880,18 @@ } .autosuggest-textarea__suggestions { + box-sizing: border-box; display: none; position: absolute; top: 100%; width: 100%; z-index: 99; - box-shadow: 0 0 15px rgba($base-shadow-color, 0.4); + box-shadow: 4px 4px 6px rgba($base-shadow-color, 0.4); background: $ui-secondary-color; + border-radius: 0 0 4px 4px; color: $ui-base-color; font-size: 14px; + padding: 6px; &.autosuggest-textarea__suggestions--visible { display: block; @@ -1898,34 +1901,36 @@ .autosuggest-textarea__suggestions__item { padding: 10px; cursor: pointer; + border-radius: 4px; - &:hover { - background: darken($ui-secondary-color, 10%); - } - + &:hover, + &:focus, + &:active, &.selected { - background: $ui-highlight-color; - color: $base-border-color; + background: darken($ui-secondary-color, 10%); } } -.autosuggest-account { - overflow: hidden; +.autosuggest-account, +.autosuggest-emoji { + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; + line-height: 18px; + font-size: 14px; } -.autosuggest-account-icon { - float: left; - margin-right: 5px; +.autosuggest-account-icon, +.autosuggest-emoji img { + display: block; + margin-right: 8px; + width: 16px; + height: 16px; } -.autosuggest-status { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - - strong { - font-weight: 500; - } +.autosuggest-account .display-name__account { + color: lighten($ui-base-color, 36%); } .character-counter__wrapper { -- cgit