Refactor channel titles to use flexbox

This commit is contained in:
Pavel Djundik 2018-02-23 23:57:45 +02:00
parent 22b02dff31
commit c051b70537
2 changed files with 27 additions and 28 deletions

View File

@ -452,16 +452,23 @@ kbd {
#viewport .rt, #viewport .rt,
#chat button.menu { #chat button.menu {
color: #ccc; color: #ccc;
display: none; display: flex;
float: left;
font-size: 14px; font-size: 14px;
line-height: 1; line-height: 1;
height: 36px; height: 36px;
margin: 6px 12px 0 -12px; width: 36px;
margin-top: 6px;
flex-shrink: 0;
}
#viewport .lt::before,
#viewport .rt::before,
#chat button.menu::before {
width: 36px; width: 36px;
} }
#viewport .lt { #viewport .lt {
display: none;
position: relative; position: relative;
} }
@ -488,17 +495,6 @@ kbd {
float: right; float: right;
} }
#viewport .rt {
display: block;
margin: 6px -12px 0 0;
}
#chat button.menu {
display: block;
float: right;
margin: 6px -8px 0 12px;
}
#viewport.rt #chat .sidebar { #viewport.rt #chat .sidebar {
right: -180px; right: -180px;
} }
@ -871,18 +867,24 @@ kbd {
border-bottom: 1px solid #e7e7e7; border-bottom: 1px solid #e7e7e7;
line-height: 48px; line-height: 48px;
height: 48px; height: 48px;
padding: 0 20px; padding: 0 6px;
overflow: hidden; overflow: hidden;
} }
#windows .header .title { #windows .header .title {
font-size: 15px; font-size: 15px;
padding-left: 14px;
flex-shrink: 0;
} }
#windows .header .topic { #windows .header .topic {
color: #777; color: #777;
margin-left: 8px; margin-left: 8px;
word-break: break-all; word-break: break-all;
flex-grow: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
#windows .window .header { #windows .window .header {
@ -972,11 +974,10 @@ kbd {
.messages .msg, .messages .msg,
.sidebar { .sidebar {
font-size: 14px; font-size: 14px;
line-height: 1.4;
} }
#windows #chat .header { #windows #chat .header {
display: block; display: flex;
} }
#chat .chat, #chat .chat,
@ -1941,16 +1942,11 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
} }
.emoji { .emoji {
display: inline-block;
font-size: 1.4em; font-size: 1.4em;
vertical-align: bottom; vertical-align: text-top;
line-height: 1; line-height: 1;
} }
.topic .emoji {
vertical-align: middle;
}
.textcomplete-item .emoji { .textcomplete-item .emoji {
width: 32px; width: 32px;
text-align: center; text-align: center;
@ -2279,7 +2275,7 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
#viewport .lt, #viewport .lt,
#viewport .channel .rt { #viewport .channel .rt {
display: block; display: flex;
} }
#windows .window .header { #windows .window .header {
@ -2298,6 +2294,10 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
right: 0; right: 0;
} }
#chat .header .title {
padding-left: 6px;
}
#chat .title::before { #chat .title::before {
display: none; display: none;
} }
@ -2472,7 +2472,6 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
/* Correctly handle multiple successive whitespace characters. /* Correctly handle multiple successive whitespace characters.
For example: user has quit ( ===> L O L <=== ) */ For example: user has quit ( ===> L O L <=== ) */
#windows .header .topic,
#chat .message .text, #chat .message .text,
#chat .motd .text, #chat .motd .text,
#chat .notice .text, #chat .notice .text,

View File

@ -9,14 +9,14 @@
> >
<div class="header"> <div class="header">
<button class="lt" aria-label="Toggle channel list"></button> <button class="lt" aria-label="Toggle channel list"></button>
<span class="title">{{name}}</span>
<span title="{{topic}}" class="topic">{{{parse topic}}}</span>
<button class="menu" aria-label="Open the context menu"></button>
{{#equal type "channel"}} {{#equal type "channel"}}
<span class="rt-tooltip tooltipped tooltipped-w" aria-label="Toggle user list"> <span class="rt-tooltip tooltipped tooltipped-w" aria-label="Toggle user list">
<button class="rt" aria-label="Toggle user list"></button> <button class="rt" aria-label="Toggle user list"></button>
</span> </span>
{{/equal}} {{/equal}}
<button class="menu" aria-label="Open the context menu"></button>
<span class="title">{{name}}</span>
<span title="{{topic}}" class="topic">{{{parse topic}}}</span>
</div> </div>
<div class="chat"> <div class="chat">
<div class="show-more{{#if messages.length}} show{{/if}}"> <div class="show-more{{#if messages.length}} show{{/if}}">