Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

css: Keep typeahead CSS together.

Aman Agrawaldf542e9a9be5
diff --git a/web/styles/typeahead.css b/web/styles/typeahead.css
index 28f798c328a..74769deed58 100644
--- a/web/styles/typeahead.css
+++ b/web/styles/typeahead.css
@@ -13,3 +13,81 @@
.typeahead {
z-index: 1051;
}
+
+.typeahead.dropdown-menu .typeahead-menu {
+ & li {
+ word-break: break-word;
+
+ & a {
+ display: flex;
+ padding: 3px 10px;
+ gap: 5px;
+ font-weight: normal;
+ /* We want to keep this `max-width` less than 320px. */
+ max-width: 292px;
+ line-height: 20px;
+ color: var(--color-dropdown-item);
+ white-space: nowrap;
+
+ /* hidden text just to maintain line height for a blank option */
+ strong:empty {
+ &::after {
+ content: ".";
+ visibility: hidden;
+ }
+ }
+
+ &:hover,
+ &:focus {
+ text-decoration: none;
+ outline: 0;
+ }
+
+ /* styles defined for user_circle here only deal with positioning of user_presence_circle
+ in typeahead list in order to ensure they are rendered correctly in in all screen sizes.
+ Most of the style rules related to color, gradient etc. which are generally common throughout
+ the app are defined in user_circles.css and are not overridden here. */
+ .user_circle {
+ width: var(--length-user-status-circle);
+ height: var(--length-user-status-circle);
+ position: relative;
+ left: -2px;
+ flex-shrink: 0;
+ align-self: center;
+ }
+
+ .typeahead-text-container {
+ align-self: center;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+
+ & > * {
+ margin-right: 3px;
+ }
+ }
+ }
+ }
+
+ .active > a {
+ &,
+ &:hover,
+ &:focus {
+ color: var(--color-active-dropdown-item);
+ background-color: var(--background-color-active-typeahead-item);
+ }
+ }
+
+ .autocomplete_secondary {
+ opacity: 0.8;
+ font-size: 85%;
+
+ & code {
+ display: inline-block;
+ }
+ }
+
+ .active .autocomplete_secondary {
+ opacity: 1;
+ }
+}
diff --git a/web/styles/zulip.css b/web/styles/zulip.css
index cde6f3735fd..f6cf9a02642 100644
--- a/web/styles/zulip.css
+++ b/web/styles/zulip.css
@@ -792,88 +792,6 @@ strong {
position: relative;
}
-/* .dropdown-menu from v2.3.2
- + https://github.com/zulip/zulip/commit/7a3a3be7e547d3e8f0ed00820835104867f2433d
- basic idea of this fix is to remove decorations from :hover and apply them only
- on :focus. */
-.typeahead.dropdown-menu .typeahead-menu {
- & li {
- word-break: break-word;
-
- & a {
- display: flex;
- padding: 3px 10px;
- gap: 5px;
- font-weight: normal;
- /* We want to keep this `max-width` less than 320px. */
- max-width: 292px;
- line-height: 20px;
- color: var(--color-dropdown-item);
- white-space: nowrap;
-
- /* hidden text just to maintain line height for a blank option */
- strong:empty {
- &::after {
- content: ".";
- visibility: hidden;
- }
- }
-
- &:hover,
- &:focus {
- text-decoration: none;
- outline: 0;
- }
-
- /* styles defined for user_circle here only deal with positioning of user_presence_circle
- in typeahead list in order to ensure they are rendered correctly in in all screen sizes.
- Most of the style rules related to color, gradient etc. which are generally common throughout
- the app are defined in user_circles.css and are not overridden here. */
- .user_circle {
- width: var(--length-user-status-circle);
- height: var(--length-user-status-circle);
- position: relative;
- left: -2px;
- flex-shrink: 0;
- align-self: center;
- }
-
- .typeahead-text-container {
- align-self: center;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-
- & > * {
- margin-right: 3px;
- }
- }
- }
- }
-
- .active > a {
- &,
- &:hover,
- &:focus {
- color: var(--color-active-dropdown-item);
- background-color: var(--background-color-active-typeahead-item);
- }
- }
-
- .autocomplete_secondary {
- opacity: 0.8;
- font-size: 85%;
-
- & code {
- display: inline-block;
- }
- }
-
- .active .autocomplete_secondary {
- opacity: 1;
- }
-}
-
.new_messages {
background-color: hsl(194deg 53% 79%);
}