Merge pull request #2643 from thelounge/astorije/sticky-userlist

Make userlist section titles sticky on scroll, improve contrasts for accessibility, use CSS variables
This commit is contained in:
Jérémie Astori 2018-07-25 00:54:45 -04:00 committed by GitHub
commit cc4ab38356
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 53 deletions

View File

@ -5,6 +5,9 @@
/* Main text color */ /* Main text color */
--body-color: #222; --body-color: #222;
/* Secondary text color, dimmed. Make sure to keep contrast WCAG 2.0 AA compliant on var(--window-bg-color) */
--body-color-muted: #767676;
/* Background color of the whole page */ /* Background color of the whole page */
--body-bg-color: #415364; --body-bg-color: #415364;
@ -369,11 +372,13 @@ kbd {
#chat .motd .from::before { #chat .motd .from::before {
content: "\f02e"; /* https://fontawesome.com/icons/bookmark?style=solid */ content: "\f02e"; /* https://fontawesome.com/icons/bookmark?style=solid */
color: var(--body-color-muted);
} }
#chat .ctcp .from::before, #chat .ctcp .from::before,
#chat .ctcp_request .from::before { #chat .ctcp_request .from::before {
content: "\f15c"; /* https://fontawesome.com/icons/file-alt?style=solid */ content: "\f15c"; /* https://fontawesome.com/icons/file-alt?style=solid */
color: var(--body-color-muted);
} }
#chat .whois .from::before { #chat .whois .from::before {
@ -958,7 +963,7 @@ background on hover (unless active) */
} }
#windows .header .topic { #windows .header .topic {
color: #777; color: var(--body-color-muted);
margin-left: 8px; margin-left: 8px;
word-break: break-all; word-break: break-all;
flex-grow: 1; flex-grow: 1;
@ -1182,7 +1187,7 @@ background on hover (unless active) */
} }
#chat .time { #chat .time {
color: #999; color: var(--body-color-muted);
padding-left: 10px; padding-left: 10px;
width: 55px; width: 55px;
} }
@ -1192,7 +1197,6 @@ background on hover (unless active) */
} }
#chat .from { #chat .from {
color: #b1c3ce;
padding-right: 10px; padding-right: 10px;
text-align: right; text-align: right;
width: 134px; width: 134px;
@ -1210,6 +1214,10 @@ background on hover (unless active) */
overflow: hidden; /* Prevents Zalgo text to expand beyond messages */ overflow: hidden; /* Prevents Zalgo text to expand beyond messages */
} }
#chat .unhandled .from {
color: var(--body-color-muted);
}
#chat .special .time, #chat .special .time,
#chat .special .from { #chat .special .from {
display: none; display: none;
@ -1277,7 +1285,7 @@ background on hover (unless active) */
#chat.colored-nicks .user.color-32 { color: #e60082; } #chat.colored-nicks .user.color-32 { color: #e60082; }
#chat .self .text { #chat .self .text {
color: #999; color: var(--body-color-muted);
} }
#chat .msg.channel_list_loading .text { #chat .msg.channel_list_loading .text {
@ -1328,14 +1336,6 @@ background on hover (unless active) */
width: 50px; width: 50px;
} }
#chat table.channel-list td.channel .inline-channel {
color: #428bca;
}
#chat table.channel-list td {
color: #555;
}
#chat.hide-status-messages .condensed, #chat.hide-status-messages .condensed,
#chat.hide-motd .motd { #chat.hide-motd .motd {
display: none !important; display: none !important;
@ -1359,7 +1359,7 @@ background on hover (unless active) */
#chat .quit .content, #chat .quit .content,
#chat .topic .content, #chat .topic .content,
#chat .topic_set_by .content { #chat .topic_set_by .content {
color: #999; color: var(--body-color-muted);
} }
#chat .action .from, #chat .action .from,
@ -1564,13 +1564,19 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
white-space: nowrap; white-space: nowrap;
} }
#chat .user-mode {
margin-bottom: 15px;
}
#chat .user-mode::before { #chat .user-mode::before {
content: ""; background: var(--window-bg-color);
border-bottom: 1px solid #eee; color: var(--body-color-muted);
display: block; display: block;
font-size: 0.85em;
line-height: 1.6; line-height: 1.6;
padding: 12px 16px 10px; padding: 5px 16px;
margin-bottom: 10px; position: sticky;
top: 0;
} }
#chat .user-mode.owner::before { #chat .user-mode.owner::before {

View File

@ -60,7 +60,7 @@ function hasRoleInChannel(channel, roles, nick) {
function scrollIntoViewNicely(el) { function scrollIntoViewNicely(el) {
// Ideally this would use behavior: "smooth", but that does not consistently work in e.g. Chrome // Ideally this would use behavior: "smooth", but that does not consistently work in e.g. Chrome
// https://github.com/iamdustan/smoothscroll/issues/28#issuecomment-364061459 // https://github.com/iamdustan/smoothscroll/issues/28#issuecomment-364061459
el.scrollIntoView({block: "nearest", inline: "nearest"}); el.scrollIntoView({block: "center", inline: "nearest"});
} }
function collapse() { function collapse() {

View File

@ -2,6 +2,7 @@
:root { :root {
--body-color: #f3f3f3; --body-color: #f3f3f3;
--body-color-muted: #b7c5d1;
--link-color: #77abd9; --link-color: #77abd9;
--window-bg-color: #303e4a; --window-bg-color: #303e4a;
--date-marker-color: #97ea70; --date-marker-color: #97ea70;
@ -106,10 +107,6 @@
color: #b7c5d1; color: #b7c5d1;
} }
#windows .header .topic {
color: #b7c5d1;
}
#viewport .lt, #viewport .lt,
#viewport .rt, #viewport .rt,
#chat button.menu, #chat button.menu,
@ -122,42 +119,11 @@
color: #f3f3f3; color: #f3f3f3;
} }
#chat .self .text {
color: #b7c5d1;
}
#chat .error, #chat .error,
#chat .error .from { #chat .error .from {
color: #f92772; color: #f92772;
} }
#chat .unhandled .from {
color: #b7c5d1;
}
#chat .msg.topic {
color: #b7c5d1;
}
#chat .time,
#chat .condensed .content,
#chat .away .content,
#chat .back .content,
#chat .join .content,
#chat .kick .content,
#chat .mode .content,
#chat .nick .content,
#chat .part .content,
#chat .quit .content,
#chat .topic .content,
#chat .topic_set_by .content {
color: #b7c5d1;
}
#chat table.channel-list td {
color: #b7c5d1;
}
#chat .msg.motd .text, #chat .msg.motd .text,
code, code,
.irc-monospace { .irc-monospace {

View File

@ -1,3 +1,4 @@
<!-- htmlmin:ignore -->
{{#diff "reset"}}{{/diff}} {{#diff "reset"}}{{/diff}}
{{#each users}} {{#each users}}
{{#diff mode}} {{#diff mode}}
@ -9,3 +10,4 @@
{{> user_name}} {{> user_name}}
{{/each}} {{/each}}
</div> </div>
<!-- htmlmin:ignore -->