gitbook-plugin-chatlog
Version:
Formatted chat logs for GitBook
157 lines (137 loc) • 3 kB
CSS
/* Hat tip to http://codepen.io/jokeyrhyme/pen/dAwet/ */
ul.chatlog {
list-style: none;
}
.chatlog__time_gap {
width: 100%;
text-align: center;
color: #778899;
font-weight: bold;
}
.chatlog__head {
width: 100%;
margin: 0 auto;
text-align: center;
}
.chatlog__head span {
font-weight: bold;
}
.chatlog {
max-width: 80%;
margin: 0 auto;
}
.chatlog .chatlog__entry {
margin: .5em;
}
.chatlog__entry {
display: flex;
flex-direction: row;
align-items: flex-end;
max-width: 85%;
}
.chatlog__entry.chatlog__entry_flip {
flex-direction: row-reverse;
}
.chatlog__avatar {
flex-shrink: 0;
flex-grow: 0;
z-index: 1;
height: 50px;
width: 50px;
border-radius: 25px;
}
.chatlog__entry .chatlog__message {
position: relative;
margin: 0 12px;
}
.chatlog__entry .chatlog__message::before {
position: absolute;
right: auto;
bottom: .6em;
left: -12px;
height: 0;
content: '';
border: 6px solid transparent;
border-right-color: #ddd;
z-index: 2;
}
.chatlog__entry.chatlog__entry_flip .chatlog__message::before {
right: -12px;
bottom: .6em;
left: auto;
border: 6px solid transparent;
border-left-color: #08f;
}
.chatlog__message {
background-color: #ddd;
padding: .5em;
border-radius: 4px;
max-width: 70%;
font-size: 14px;
font-family: "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
font-smooth: always;
}
.chatlog__message .chatlog__timestamp {
display: none;
}
/**
* Tooltip Styles
*/
/* Add this attribute to the element that needs a tooltip */
[data-timetip] {
position: relative;
z-index: 2;
cursor: pointer;
}
/* Hide the tooltip content by default */
[data-timetip]:before,
[data-timetip]:after {
visibility: hidden;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: progid: DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
pointer-events: none;
}
/* Position tooltip above the element */
[data-timetip]:before {
position: absolute;
bottom: 100%;
left: 50%;
margin-bottom: 5px;
margin-left: -80px;
padding: 7px;
width: 160px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background-color: #000;
background-color: hsla(0, 0%, 20%, 0.9);
color: #fff;
content: attr(data-timetip);
text-align: center;
font-size: 14px;
line-height: 1.2;
}
/* Triangle hack to make tooltip look like a speech bubble */
[data-timetip]:after {
position: absolute;
bottom: 100%;
left: 50%;
margin-left: -5px;
width: 0;
border-top: 5px solid #000;
border-top: 5px solid hsla(0, 0%, 20%, 0.9);
border-right: 5px solid transparent;
border-left: 5px solid transparent;
content: " ";
font-size: 0;
line-height: 0;
}
/* Show tooltip content on hover */
[data-timetip]:hover:before,
[data-timetip]:hover:after {
visibility: visible;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: progid: DXImageTransform.Microsoft.Alpha(Opacity=100);
opacity: 1;
}