pleroma-fe/src/components/rich_content/rich_content.scss

458 lines
7 KiB
SCSS
Raw Normal View History

2021-06-07 12:49:54 +03:00
.RichContent {
2024-02-22 18:04:28 +02:00
font-family: var(--font);
2026-05-12 22:15:48 +03:00
.mfm {
display: inline-block;
2026-07-07 11:40:37 +03:00
&.-scale {
font-size: calc(var(--emoji-size) / 2);
}
&:not(.-scale) {
--emoji-size: 2em;
}
&.-pause {
animation-play-state: paused;
}
2026-07-07 11:41:21 +03:00
&[data-mfm-operator="sparkle"] {
position: relative;
&::before,
&::after {
content: '';
position: absolute;
opacity: 0.4;
z-index: -1;
animation-name: cheap-sparkle;
animation-duration: 1s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
}
&::before {
left: 0;
animation-direction: alternate;
}
&::after {
right: 0;
animation-direction: alternate-reverse;
}
}
.emoji {
/* Misskey's emoji width knows no bounds */
/* stylelint-disable-next-line declaration-no-important */
max-width: unset !important;
}
2026-05-12 22:15:48 +03:00
}
2026-07-07 11:40:37 +03:00
&:hover .mfm {
animation-play-state: running;
}
&.-faint {
2025-08-10 23:06:33 +03:00
color: var(--text);
/* stylelint-disable declaration-no-important */
--text: var(--textFaint) !important;
--link: var(--linkFaint) !important;
--funtextGreentext: var(--funtextGreentextFaint) !important;
--funtextCyantext: var(--funtextCyantextFaint) !important;
/* stylelint-enable declaration-no-important */
2025-01-27 11:28:46 +02:00
a {
color: var(--linkFaint);
}
}
2021-06-07 12:49:54 +03:00
blockquote {
2022-12-14 19:26:20 -05:00
margin: 0.2em 0 0.2em 0.2em;
2021-06-07 12:49:54 +03:00
font-style: italic;
2024-02-22 18:04:28 +02:00
border-left: 0.2em solid var(--textFaint);
2022-12-14 19:26:20 -05:00
padding-left: 1em;
2021-06-07 12:49:54 +03:00
}
pre {
overflow: auto;
}
code,
samp,
kbd,
var,
pre {
2024-02-22 18:04:28 +02:00
font-family: var(--monoFont);
2021-06-07 12:49:54 +03:00
}
p {
2023-01-09 13:02:16 -05:00
margin: 0 0 1em;
2021-06-07 12:49:54 +03:00
}
p:last-child {
2023-01-09 13:02:16 -05:00
margin: 0;
2021-06-07 12:49:54 +03:00
}
h1 {
font-size: 1.1em;
line-height: 1.2em;
margin: 1.4em 0;
}
h2 {
font-size: 1.1em;
margin: 1em 0;
}
h3 {
font-size: 1em;
margin: 1.2em 0;
}
h4 {
margin: 1.1em 0;
}
.img {
display: inline-block;
2025-08-21 17:36:43 +03:00
// fix vertical alignment of stealable emoji
button {
display: inline-flex;
}
2021-06-07 12:49:54 +03:00
}
.emoji {
display: inline-block;
width: var(--emoji-size, 32px);
height: var(--emoji-size, 32px);
2021-06-07 12:49:54 +03:00
}
2026-05-10 17:21:49 +03:00
&.-allow-non-square-emoji {
.emoji {
width: auto;
max-width: calc(var(--emoji-size, 32px) * 3);
min-width: var(--emoji-size, 32px);
}
}
2021-06-07 12:49:54 +03:00
.img,
video {
max-width: 100%;
max-height: 400px;
vertical-align: middle;
object-fit: contain;
}
.greentext {
color: var(--funtextGreentext);
}
.cyantext {
color: var(--funtextCyantext);
}
2021-06-07 12:49:54 +03:00
}
2024-04-03 21:27:25 +03:00
a .RichContent {
/* stylelint-disable-next-line declaration-no-important */
color: var(--link) !important;
}
2026-05-12 22:15:48 +03:00
@keyframes mfm-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes mfm-spinX {
0% {
transform: perspective(8em) rotateX(0);
}
100% {
transform: perspective(8em) rotateX(360deg);
}
}
@keyframes mfm-spinY {
0% {
transform: perspective(8em) rotateY(0);
}
100% {
transform: perspective(8em) rotateY(360deg);
}
}
@keyframes mfm-jump {
0% {
transform: translateY(0)
}
25% {
transform: translateY(-1em)
2026-05-12 22:15:48 +03:00
}
50% {
transform: translateY(0)
}
75% {
transform: translateY(-0.5em)
2026-05-12 22:15:48 +03:00
}
100% {
transform: translateY(0)
}
}
@keyframes mfm-bounce {
0% {
transform: translateY(0) scale(1)
}
25% {
transform: translateY(-16px) scale(1)
}
50% {
transform: translateY(0) scale(1)
}
75% {
transform: translateY(0) scale(1.5,.75)
}
100% {
transform: translateY(0) scale(1)
}
}
@keyframes mfm-twitch {
0% {
transform: translate(7px,-2px)
}
5% {
transform: translate(-3px,1px)
}
10% {
transform: translate(-7px,-1px)
}
15% {
transform: translateY(-1px)
}
20% {
transform: translate(-8px,6px)
}
25% {
transform: translate(-4px,-3px)
}
30% {
transform: translate(-4px,-6px)
}
35% {
transform: translate(-8px,-8px)
}
40% {
transform: translate(4px,6px)
}
45% {
transform: translate(-3px,1px)
}
50% {
transform: translate(2px,-10px)
}
55% {
transform: translate(-7px)
}
60% {
transform: translate(-2px,4px)
}
65% {
transform: translate(3px,-8px)
}
70% {
transform: translate(6px,7px)
}
75% {
transform: translate(-7px,-2px)
}
80% {
transform: translate(-7px,-8px)
}
85% {
transform: translate(9px,3px)
}
90% {
transform: translate(-3px,-2px)
}
95% {
transform: translate(-10px,2px)
}
100% {
transform: translate(-2px,-6px)
}
}
@keyframes mfm-shake {
0% {
transform: translate(-3px,-1px) rotate(-8deg)
}
5% {
transform: translateY(-1px) rotate(-10deg)
}
10% {
transform: translate(1px,-3px) rotate(0)
}
15% {
transform: translate(1px,1px) rotate(11deg)
}
20% {
transform: translate(-2px,1px) rotate(1deg)
}
25% {
transform: translate(-1px,-2px) rotate(-2deg)
}
30% {
transform: translate(-1px,2px) rotate(-3deg)
}
35% {
transform: translate(2px,1px)rotate(6deg)
}
40% {
transform: translate(-2px,-3px)rotate(-9deg)
}
45% {
transform: translateY(-1px)rotate(-12deg)
}
50% {
transform: translate(1px,2px)rotate(10deg)
}
55% {
transform: translateY(-3px)rotate(8deg)
}
60% {
transform: translate(1px,-1px)rotate(8deg)
}
65% {
transform: translateY(-1px)rotate(-7deg)
}
70% {
transform: translate(-1px,-3px)rotate(6deg)
}
75% {
transform: translateY(-2px)rotate(4deg)
}
80% {
transform: translate(-2px,-1px)rotate(3deg)
}
85% {
transform: translate(1px,-3px)rotate(-10deg)
}
90% {
transform: translate(1px)rotate(3deg)
}
95% {
transform: translate(-2px)rotate(-3deg)
}
100% {
transform: translate(2px,1px)rotate(2deg)
}
}
@keyframes mfm-rubberBand {
0% {
transform: scale(1)
}
30% {
transform: scale(1.25,.75)
}
40% {
transform: scale(.75,1.25)
}
50% {
transform: scale(1.15,.85)
}
65% {
transform: scale(.95,1.05)
}
75% {
transform: scale(1.05,.95)
}
100% {
transform: scale(1)
}
}
@keyframes mfm-rainbow {
0% {
filter: hue-rotate()contrast(150%)saturate(150%)
}
100% {
filter: hue-rotate(360deg)contrast(150%)saturate(150%)
}
}
2026-07-07 11:41:21 +03:00
@keyframes cheap-sparkle {
0% {
filter: hue-rotate()contrast(150%)saturate(150%);
transform: translateY(-0.5em);
}
100% {
filter: hue-rotate(360deg)contrast(150%)saturate(150%);
transform: translateY(0.5em);
}
}