zulip/static/styles/reactions.scss

302 lines
6.3 KiB
SCSS
Raw Normal View History

.message_reactions {
padding-left: 46px;
overflow: hidden;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
.message_reaction {
float: left;
margin: 0.15em;
padding: 0 2px 0 0;
height: 19px;
cursor: pointer;
background-color: hsl(0, 0%, 100%);
border: 1px solid hsl(194, 37%, 84%);
border-radius: 4px;
&.reacted {
background-color: hsl(195, 50%, 95%);
}
&:hover {
border: 1px solid hsl(200, 100%, 40%);
}
+ .reaction_button {
visibility: hidden;
pointer-events: none;
margin: 2px 0.1em 3px 0.1em;
padding: 3px;
height: 14px;
border-radius: 4px;
padding-left: 0.3em;
border: 1px solid hsl(0, 0%, 73%);
padding-right: 0.3em;
float: left;
}
.emoji {
display: inline-block;
vertical-align: top;
top: 0px;
margin: 1px 3px;
height: 17px;
width: 17px;
position: relative;
}
}
.message_reaction_count {
position: relative;
top: 4px;
font-size: 0.8em;
display: inline-block;
vertical-align: top;
color: hsl(200, 100%, 40%);
margin: 0px 1px 0px 0px;
line-height: 1em;
}
i {
font-size: 1.3em;
float: left;
color: hsl(0, 0%, 33%);
}
&:hover .message_reaction + .reaction_button {
visibility: visible;
pointer-events: all;
background-color: hsl(0, 0%, 98%);
}
.reaction_button {
i {
font-size: 1em;
margin-right: 3px;
}
&:hover i {
color: hsl(200, 100%, 40%);
}
&:only-child {
display: none;
}
&:hover {
border: 1px solid hsl(200, 100%, 40%);
background-color: hsl(195, 50%, 95%);
cursor: pointer;
opacity: 1.0;
color: hsl(200, 100%, 40%);
}
.message_reaction_count {
font-size: 1.1em;
color: hsl(0, 0%, 33%);
margin-left: 3px;
top: 0.5px;
}
&:hover .message_reaction_count {
color: hsl(200, 100%, 40%);
}
}
}
.private-message .message_reactions .message_reaction {
background-color: hsl(192, 20%, 95%);
&.reacted {
background-color: hsl(196, 51%, 93%);
border-color: hsl(193, 38%, 70%);
}
}
.reaction_button_visible {
visibility: visible !important;
pointer-events: all !important;
opacity: 1 !important;
color: hsl(0, 0%, 73%);
}
.emoji-info-popover {
padding: 0;
height: 370px;
.popover-content {
padding: 0;
}
&.bottom .arrow {
border-bottom-color: hsl(0, 0%, 93%);
}
&.top .arrow {
border-top-color: hsl(0, 0%, 93%);
}
}
.emoji-popover {
display: block;
width: 250px;
Add frontend support for emoji reactions. This commit replaces the placeholder "clipboard" button with a reaction button. This is done on any message that can't be edited. Also, on messages sent by the user the actions popover (toggled by the down chevron icon) contains an option to add a reaction. When clicked, a popover with a search bar and a list of emojis is displayed. If the right sidebar is collapsed (the viewport is small), the popover is placed to the left of the button. Focus is set to the search bar. Typing in the search bar filters emojis. Emojis with which the user has reacted to this message are highlighted. Clicking them sends an API request to remove that reaction. Clicking on non-highlighted emojis sends an API request to add a reaction. When the popover loses focus it is closed. The frontend listens for reaction events. When an add-reaction event is received, the emoji is displayed at the bottom of the message with a count initialized to 1. If there was an existing reaction to the message with the same emoji, the count is incremented. Old messages fetched from the server contain reactions. They are displayed (along with title and count) at the bottom of each message. When clicking the emoji reaction at the bottom of the message, if the user has already reacted with that emoji to this message, the reaction is removed and the count is decremented. Otherwise, a reaction is added and the count is incremented. Hovering over the emoji reaction at the bottom of the message displays a list of users who have reacted with this emoji along with the emoji name. Hovering over the emoji reactions at the bottom of the message displays a button to add a reaction. Fixes #541.
2016-12-02 13:23:23 +01:00
.reacted {
background-color: hsl(195, 50%, 95%);
border-color: hsl(195, 52%, 79%);
}
.emoji-popover-top {
position: relative;
padding: 8px 10px;
margin-bottom: 0px;
background-color: hsl(0, 0%, 93%);
border-radius: 5px 5px 0px 0px;
Add frontend support for emoji reactions. This commit replaces the placeholder "clipboard" button with a reaction button. This is done on any message that can't be edited. Also, on messages sent by the user the actions popover (toggled by the down chevron icon) contains an option to add a reaction. When clicked, a popover with a search bar and a list of emojis is displayed. If the right sidebar is collapsed (the viewport is small), the popover is placed to the left of the button. Focus is set to the search bar. Typing in the search bar filters emojis. Emojis with which the user has reacted to this message are highlighted. Clicking them sends an API request to remove that reaction. Clicking on non-highlighted emojis sends an API request to add a reaction. When the popover loses focus it is closed. The frontend listens for reaction events. When an add-reaction event is received, the emoji is displayed at the bottom of the message with a count initialized to 1. If there was an existing reaction to the message with the same emoji, the count is incremented. Old messages fetched from the server contain reactions. They are displayed (along with title and count) at the bottom of each message. When clicking the emoji reaction at the bottom of the message, if the user has already reacted with that emoji to this message, the reaction is removed and the count is decremented. Otherwise, a reaction is added and the count is incremented. Hovering over the emoji reaction at the bottom of the message displays a list of users who have reacted with this emoji along with the emoji name. Hovering over the emoji reactions at the bottom of the message displays a button to add a reaction. Fixes #541.
2016-12-02 13:23:23 +01:00
.fa-search {
position: absolute;
color: hsl(0, 0%, 73%);
top: 15px;
left: 17px;
z-index: 3;
}
Add frontend support for emoji reactions. This commit replaces the placeholder "clipboard" button with a reaction button. This is done on any message that can't be edited. Also, on messages sent by the user the actions popover (toggled by the down chevron icon) contains an option to add a reaction. When clicked, a popover with a search bar and a list of emojis is displayed. If the right sidebar is collapsed (the viewport is small), the popover is placed to the left of the button. Focus is set to the search bar. Typing in the search bar filters emojis. Emojis with which the user has reacted to this message are highlighted. Clicking them sends an API request to remove that reaction. Clicking on non-highlighted emojis sends an API request to add a reaction. When the popover loses focus it is closed. The frontend listens for reaction events. When an add-reaction event is received, the emoji is displayed at the bottom of the message with a count initialized to 1. If there was an existing reaction to the message with the same emoji, the count is incremented. Old messages fetched from the server contain reactions. They are displayed (along with title and count) at the bottom of each message. When clicking the emoji reaction at the bottom of the message, if the user has already reacted with that emoji to this message, the reaction is removed and the count is decremented. Otherwise, a reaction is added and the count is incremented. Hovering over the emoji reaction at the bottom of the message displays a list of users who have reacted with this emoji along with the emoji name. Hovering over the emoji reactions at the bottom of the message displays a button to add a reaction. Fixes #541.
2016-12-02 13:23:23 +01:00
.emoji-popover-filter {
margin: auto;
padding-left: 22px;
width: calc(100% - 22px - 8px);
}
}
.emoji-popover-category-tabs {
/* Flex needed here to work around #7511 (90% zoom issues in firefox) */
display: flex;
background-color: hsl(0, 0%, 93%);
width: 100%;
box-sizing: border-box;
overflow: hidden;
.emoji-popover-tab-item {
display: inline-block;
padding-top: 8px;
width: 25px;
height: 25px;
text-align: center;
font-size: 16px;
cursor: pointer;
/* Flex needed here to work around #7511 (90% zoom issues in firefox) */
flex-grow: 1;
&.active {
background-color: hsla(0, 0%, 100%, 0.2);
}
}
}
.emoji-popover-emoji-map,
.emoji-search-results-container {
padding: 0px;
position: relative;
overflow-x: hidden;
overflow-y: auto;
display: block;
width: 247px;
padding-left: 3px;
}
.emoji-search-results-container {
height: 283px;
.emoji-popover-results-heading {
font-weight: 600;
padding: 5px 3px 3px 5px;
font-size: 17px;
}
}
.emoji-popover-emoji-map {
height: 250px;
.emoji-popover-subheading {
font-weight: 600;
padding: 5px 3px;
}
}
Add frontend support for emoji reactions. This commit replaces the placeholder "clipboard" button with a reaction button. This is done on any message that can't be edited. Also, on messages sent by the user the actions popover (toggled by the down chevron icon) contains an option to add a reaction. When clicked, a popover with a search bar and a list of emojis is displayed. If the right sidebar is collapsed (the viewport is small), the popover is placed to the left of the button. Focus is set to the search bar. Typing in the search bar filters emojis. Emojis with which the user has reacted to this message are highlighted. Clicking them sends an API request to remove that reaction. Clicking on non-highlighted emojis sends an API request to add a reaction. When the popover loses focus it is closed. The frontend listens for reaction events. When an add-reaction event is received, the emoji is displayed at the bottom of the message with a count initialized to 1. If there was an existing reaction to the message with the same emoji, the count is incremented. Old messages fetched from the server contain reactions. They are displayed (along with title and count) at the bottom of each message. When clicking the emoji reaction at the bottom of the message, if the user has already reacted with that emoji to this message, the reaction is removed and the count is decremented. Otherwise, a reaction is added and the count is incremented. Hovering over the emoji reaction at the bottom of the message displays a list of users who have reacted with this emoji along with the emoji name. Hovering over the emoji reactions at the bottom of the message displays a button to add a reaction. Fixes #541.
2016-12-02 13:23:23 +01:00
.emoji-popover-emoji {
display: inline-block;
margin: 0;
padding: 6px;
cursor: pointer;
border-radius: 0.5em;
height: 25px;
width: 25px;
&.reacted.reaction:focus {
background-color: hsl(195, 55%, 88%);
outline: none;
}
&:not(.reacted):focus {
background-color: hsl(0, 0%, 93%);
outline: none;
}
&.hide {
display: none;
}
.emoji {
top: 6px;
}
}
}
.emoji_alt_code {
position: relative;
top: 4px;
font-size: 0.8em;
display: inline-block;
vertical-align: top;
margin: 0px 1px 0px 0px;
line-height: 1em;
}
.typeahead .emoji {
top: 2px;
}
.emoji-showcase-container {
position: relative;
background-color: hsl(0, 0%, 93%);
min-height: 44px;
width: 250px;
.emoji-preview {
position: absolute;
width: 32px;
height: 32px;
left: 5px;
top: 6px;
margin-top: 0px;
}
.emoji-canonical-name {
position: relative;
top: 12px;
margin-left: 50px;
font-size: 16px;
font-weight: 600;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}