revite/src/components/common/messaging/attachments/Attachment.module.scss
insert fbad5aef92 Merge branch 'images' into 'master'
replace js image scaling with css for message attatchments

See merge request revolt/revite!3
2021-07-04 17:53:55 +00:00

126 lines
2.4 KiB
SCSS

.attachment {
border-radius: 6px;
margin: .125rem 0 .125rem;
height: auto;
max-height: 640px;
max-width: min(480px, 100%);
object-fit: contain;
&[data-spoiler="true"] {
filter: blur(30px);
pointer-events: none;
}
&[data-has-content="true"] {
margin-top: 4px;
}
&.image {
cursor: pointer;
}
&.video {
.actions {
padding: 10px 12px;
border-radius: 6px 6px 0 0;
}
video {
width: 100%;
border-radius: 0 0 6px 6px;
}
}
&.audio {
gap: 4px;
padding: 6px;
display: flex;
border-radius: 6px;
flex-direction: column;
background: var(--secondary-background);
max-width: 400px;
> audio {
width: 100%;
}
}
&.file {
> div {
width: 400px;
padding: 12px;
user-select: none;
width: fit-content;
border-radius: 6px;
}
}
&.text {
display: flex;
overflow: hidden;
max-width: 800px;
border-radius: 6px;
flex-direction: column;
.textContent {
height: 140px;
padding: 12px;
overflow-x: auto;
overflow-y: auto;
border-radius: 0 !important;
background: var(--secondary-header);
pre {
margin: 0;
}
pre code {
font-family: var(--monoscape-font), sans-serif;
}
&[data-loading="true"] {
display: flex;
> * {
flex-grow: 1;
}
}
}
}
}
.actions {
gap: 8px;
padding: 8px;
display: flex;
overflow: none;
max-width: 100%;
align-items: center;
flex-direction: row;
color: var(--foreground);
background: var(--secondary-background);
> svg {
flex-shrink: 0;
}
.info {
display: flex;
flex-direction: column;
flex-grow: 1;
> span {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.filesize {
font-size: 10px;
color: var(--secondary-foreground);
}
}
}