cinny/src/app/molecules/message/Message.scss

357 lines
6.4 KiB
SCSS
Raw Normal View History

2021-07-28 22:15:52 +09:00
@use '../../atoms/scroll/scrollbar';
.message,
.ph-msg {
padding: var(--sp-ultra-tight) var(--sp-normal);
padding-right: var(--sp-extra-tight);
display: flex;
&:hover {
background-color: var(--bg-surface-hover);
2021-08-11 16:59:01 +09:00
& .message__options {
display: flex;
}
2021-07-28 22:15:52 +09:00
}
[dir=rtl] & {
padding: {
left: var(--sp-extra-tight);
right: var(--sp-normal);
}
}
&__avatar-container {
padding-top: 6px;
}
2021-08-11 16:59:01 +09:00
&__avatar-container{
2021-07-28 22:15:52 +09:00
margin-right: var(--sp-tight);
[dir=rtl] & {
margin: {
left: var(--sp-tight);
right: 0;
}
}
}
&__main-container {
flex: 1;
min-width: 0;
2021-08-11 16:59:01 +09:00
position: relative;
2021-07-28 22:15:52 +09:00
}
}
.message {
&--full + &--full,
&--content-only + &--full,
& + .timeline-change,
.timeline-change + & {
margin-top: var(--sp-normal);
}
&__avatar-container {
width: var(--av-small);
}
}
.ph-msg {
&__avatar {
width: var(--av-small);
height: var(--av-small);
background-color: var(--bg-surface-hover);
border-radius: var(--bo-radius);
}
&__header,
&__content > div {
margin: var(--sp-ultra-tight) 0;
margin-right: var(--sp-extra-tight);
height: var(--fs-b1);
width: 100%;
max-width: 100px;
background-color: var(--bg-surface-hover);
border-radius: calc(var(--bo-radius) / 2);
[dir=rtl] & {
margin: {
right: 0;
left: var(--sp-extra-tight);
}
}
}
&__content {
display: flex;
flex-wrap: wrap;
}
&__content > div:nth-child(1n) {
max-width: 10%;
}
&__content > div:nth-child(2n) {
max-width: 50%;
}
}
2021-08-10 20:28:44 +09:00
.message__reply,
.message__content,
.message__reactions {
max-width: 640px;
2021-08-12 15:42:59 +09:00
min-width: 0;
2021-08-10 20:28:44 +09:00
}
2021-07-28 22:15:52 +09:00
.message__header {
display: flex;
align-items: baseline;
& .message__profile {
min-width: 0;
color: var(--tc-surface-high);
2021-08-11 16:59:01 +09:00
margin-right: var(--sp-tight);
[dir=rtl] & {
margin-left: var(--sp-tight);
margin-right: 0;
}
2021-07-28 22:15:52 +09:00
& > .text {
color: inherit;
font-weight: 500;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
2021-08-11 17:28:53 +09:00
& > .text:last-child { display: none; }
&:hover {
& > .text:first-child { display: none; }
& > .text:last-child { display: block; }
}
2021-07-28 22:15:52 +09:00
}
& .message__time {
2021-08-11 17:28:53 +09:00
flex: 1;
display: flex;
justify-content: flex-end;
2021-07-28 22:15:52 +09:00
& > .text {
2021-08-11 17:28:53 +09:00
white-space: nowrap;
2021-07-28 22:15:52 +09:00
color: var(--tc-surface-low);
}
}
}
2021-08-10 20:28:44 +09:00
.message__reply {
.text {
color: var(--tc-surface-low);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.ic-raw {
width: 16px;
height: 14px;
}
}
2021-07-28 22:15:52 +09:00
.message__content {
word-break: break-word;
& > .text > * {
white-space: pre-wrap;
}
& a {
word-break: break-all;
}
2021-08-11 16:59:01 +09:00
&-edited {
color: var(--tc-surface-low);
}
2021-07-28 22:15:52 +09:00
}
2021-08-10 20:28:44 +09:00
.message__reactions {
display: flex;
2021-08-15 17:29:09 +09:00
flex-wrap: wrap;
& .ic-btn-surface {
display: none;
padding: var(--sp-ultra-tight);
margin-top: var(--sp-extra-tight);
}
&:hover .ic-btn-surface {
display: block;
}
2021-08-10 20:28:44 +09:00
}
2021-07-28 22:15:52 +09:00
.msg__reaction {
2021-08-10 20:28:44 +09:00
margin: var(--sp-extra-tight) var(--sp-extra-tight) 0 0;
padding: 0 var(--sp-ultra-tight);
min-height: 26px;
2021-07-28 22:15:52 +09:00
display: inline-flex;
align-items: center;
color: var(--tc-surface-normal);
2021-08-10 20:28:44 +09:00
background-color: var(--bg-surface-low);
2021-07-28 22:15:52 +09:00
border: 1px solid var(--bg-surface-border);
2021-08-10 20:28:44 +09:00
border-radius: 4px;
2021-07-28 22:15:52 +09:00
cursor: pointer;
2021-08-10 20:28:44 +09:00
& .emoji {
width: 14px;
height: 14px;
margin: 2px;
}
&-count {
margin: 0 var(--sp-ultra-tight);
color: var(--tc-surface-normal)
}
&-tooltip .emoji {
width: 14px;
height: 14px;
margin: 0 var(--sp-ultra-tight);
margin-bottom: -2px;
}
2021-07-28 22:15:52 +09:00
[dir=rtl] & {
margin: {
right: 0;
left: var(--sp-extra-tight);
}
}
@media (hover: hover) {
&:hover {
background-color: var(--bg-surface-hover);
}
}
&:active {
background-color: var(--bg-surface-active)
}
&--active {
background-color: var(--bg-caution-active);
@media (hover: hover) {
&:hover {
background-color: var(--bg-caution-hover);
}
}
&:active {
background-color: var(--bg-caution-active)
}
}
}
2021-08-11 16:59:01 +09:00
.message__options {
position: absolute;
top: 0;
right: 60px;
transform: translateY(-50%);
border-radius: var(--bo-radius);
box-shadow: var(--bs-surface-border);
background-color: var(--bg-surface-low);
display: none;
[dir=rtl] & {
left: 60px;
right: unset;
}
}
2021-07-28 22:15:52 +09:00
// markdown formating
2021-08-10 20:28:44 +09:00
.message__content {
2021-07-28 22:15:52 +09:00
& h1,
& h2 {
color: var(--tc-surface-high);
margin: var(--sp-extra-loose) 0 var(--sp-normal);
line-height: var(--lh-h1);
}
& h3,
& h4 {
color: var(--tc-surface-high);
margin: var(--sp-loose) 0 var(--sp-tight);
line-height: var(--lh-h2);
}
& h5,
& h6 {
color: var(--tc-surface-high);
margin: var(--sp-normal) 0 var(--sp-extra-tight);
line-height: var(--lh-s1);
}
& hr {
border-color: var(--bg-surface-border);
}
.text img {
margin: var(--sp-ultra-tight) 0;
max-width: 296px;
border-radius: calc(var(--bo-radius) / 2);
}
& p,
& pre,
& blockquote {
margin: 0;
padding: 0;
}
& pre,
& blockquote {
margin: var(--sp-ultra-tight) 0;
padding: var(--sp-extra-tight);
background-color: var(--bg-surface-hover) !important;
border-radius: calc(var(--bo-radius) / 2);
}
& pre {
div {
background: none !important;
margin: 0 !important;
}
span {
background: none !important;
}
.linenumber {
min-width: 2.25em !important;
}
}
& code {
padding: 0 !important;
color: var(--tc-code) !important;
white-space: pre-wrap;
@include scrollbar.scroll;
@include scrollbar.scroll__h;
@include scrollbar.scroll--auto-hide;
}
& pre code {
color: var(--tc-surface-normal) !important;
}
& blockquote {
padding-left: var(--sp-extra-tight);
border-left: 4px solid var(--bg-surface-active);
white-space: initial !important;
& > * {
white-space: pre-wrap;
}
[dir=rtl] & {
padding: {
left: 0;
right: var(--sp-extra-tight);
}
border: {
left: none;
right: 4px solid var(--bg-surface-active);
}
}
}
& ul,
& ol {
margin: var(--sp-ultra-tight) 0;
padding-left: 24px;
white-space: initial !important;
& > * {
white-space: pre-wrap;
}
[dir=rtl] & {
padding: {
left: 0;
right: 24px;
}
}
}
}