webapp/src/components/Editor/Prosemirror.scss

323 lines
5.6 KiB
SCSS
Raw Normal View History

.ProseMirror {
2023-07-14 06:24:45 +00:00
font-size: 1.6rem;
outline: none;
min-height: 300px;
}
.ProseMirror p.is-editor-empty:first-child::before {
content: attr(data-placeholder);
float: left;
height: 0;
pointer-events: none;
font-weight: 500;
font-size: 20px;
line-height: 30px;
opacity: 0.3;
}
// Keeping the cursor active when moving outside the editable area
.articleEditor p,
.articleEditor ul,
.articleEditor h4,
.articleEditor ol {
box-sizing: content-box;
flex: 0 0 auto;
@media (min-width: 768px) {
padding-left: calc(21.9% + 3px);
max-width: 72.7%;
}
@media (min-width: 1200px) {
padding-left: calc(21.5% + 3px);
max-width: 64.9%;
}
}
.articleEditor blockquote,
.articleEditor figure,
2023-08-09 07:49:08 +00:00
.articleEditor .uploadedImage,
.articleEditor article[data-type='incut'] {
@media (min-width: 768px) {
margin-left: calc(21.9% + 3px) !important;
max-width: 73.6%;
}
@media (min-width: 1200px) {
margin-left: calc(21.4% + 3px) !important;
max-width: 65.3%;
}
}
.articleEditor h2 {
@media (min-width: 768px) {
padding-left: calc(21.9% + 2px);
max-width: 72.7%;
}
@media (min-width: 1200px) {
padding-left: 21.5%;
max-width: 87.1%;
}
}
.articleEditor h3 {
@media (min-width: 768px) {
padding-left: calc(21.9% + 2px);
}
@media (min-width: 1200px) {
padding-left: 21.5%;
max-width: 87.1%;
}
}
.articleEditor * p,
.articleEditor * h2,
.articleEditor * h3,
.articleEditor * h4 {
@media (min-width: 768px) {
padding-left: unset;
max-width: unset;
}
}
/* Give a remote user a caret */
.collaboration-cursor__caret {
border-left: 1px solid #0d0d0d;
border-right: 1px solid #0d0d0d;
margin-left: -1px;
margin-right: -1px;
pointer-events: none;
position: relative;
word-break: normal;
}
/* Render the username above the caret */
.collaboration-cursor__label {
border-radius: 3px 3px 3px 0;
color: #0d0d0d;
font-size: 12px;
font-style: normal;
font-weight: 600;
left: -1px;
line-height: normal;
padding: 0.1rem 0.3rem;
position: absolute;
top: -1.4em;
user-select: none;
white-space: nowrap;
}
.embed-wrapper {
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
background: #f1f1f1;
margin: 4rem 0;
iframe {
border: none;
overflow: hidden;
}
}
.uploadedImage {
max-height: 80vh;
margin: auto;
display: block;
width: unset !important;
}
2023-05-04 15:55:38 +00:00
.horizontalRule {
border-top: 2px solid #000;
}
2023-05-09 17:31:28 +00:00
mark.highlight {
box-decoration-break: clone;
2023-07-14 06:24:45 +00:00
padding: 0.2em 0;
2023-05-09 17:31:28 +00:00
}
// custom atibutes fro TipTap Nodes
2023-07-05 22:58:08 +00:00
@include media-breakpoint-up(sm) {
[data-float] {
max-width: 50%;
}
2023-07-05 22:58:08 +00:00
[data-float='left'] {
float: left;
max-width: 35%;
margin: 1rem 2.2em 0 0;
}
2023-07-05 22:58:08 +00:00
[data-float='right'] {
float: right;
margin: 1rem 0 1rem 2.2em;
max-width: 35%;
}
2023-07-05 22:58:08 +00:00
[data-float='half-left'] {
float: left;
margin: 1rem 1rem 0;
2023-07-14 06:24:45 +00:00
@include media-breakpoint-up(md) {
max-width: 50%;
min-width: 30%;
}
2023-07-05 22:58:08 +00:00
}
2023-07-05 22:58:08 +00:00
[data-float='half-right'] {
float: right;
margin: 1rem 0;
2023-07-14 06:24:45 +00:00
@include media-breakpoint-up(md) {
max-width: 50%;
min-width: 30%;
}
2023-07-05 22:58:08 +00:00
}
}
.ProseMirror blockquote {
p:last-child {
margin-bottom: 0;
}
&[data-type='quote'] {
2023-07-14 06:24:45 +00:00
@include font-size(1.4rem);
border: solid #000;
border-width: 0 0 0 2px;
margin: 1.6rem 0;
2023-07-05 22:58:08 +00:00
padding: 0 0 0 1.5em;
&[data-float='left'] {
padding-left: 0;
padding-right: 0;
margin-right: 1.6rem;
border-width: 0 2px 0 0;
}
&[data-float='right'] {
margin-left: 1.6rem;
border-width: 0 0 0 2px;
}
}
&[data-type='punchline'] {
border: solid #000;
border-width: 2px 0;
2023-07-05 22:58:08 +00:00
@include font-size(3.2rem);
font-weight: 700;
2023-07-05 22:58:08 +00:00
line-height: 1.2;
margin: 1em 0;
padding: 2.4rem 0;
&[data-float='left'],
&[data-float='right'] {
2023-07-05 22:58:08 +00:00
@include font-size(2.2rem);
line-height: 1.4;
}
@include media-breakpoint-up(sm) {
&[data-float='left'] {
margin-right: 1.5em;
}
&[data-float='right'] {
margin-left: 1.5em;
}
}
}
}
.ProseMirror article[data-type='incut'] {
background: #f1f2f3;
2023-07-14 06:24:45 +00:00
@include font-size(1.4rem);
2023-07-05 22:58:08 +00:00
margin: 1em -1rem;
padding: 2em 2rem;
transition: background 0.3s ease-in-out;
2023-07-05 22:58:08 +00:00
@include media-breakpoint-up(sm) {
margin-left: -2rem;
margin-right: -2rem;
}
@include media-breakpoint-up(lg) {
margin-right: -6%;
padding-left: 3em;
padding-right: 3em;
}
@include media-breakpoint-up(lg) {
margin-left: -3em;
margin-right: -3em;
}
&[data-float] img {
float: none;
max-width: unset;
width: 100% !important;
margin: 0;
}
2023-07-05 22:58:08 +00:00
&[data-float='left'],
&[data-float='half-left'] {
margin-left: -1rem;
@include media-breakpoint-up(sm) {
margin-left: -2rem;
margin-right: 2rem;
}
@include media-breakpoint-up(lg) {
margin-left: -6%;
}
@include media-breakpoint-up(xl) {
margin-left: -12.5%;
}
}
&[data-float='right'],
&[data-float='half-right'] {
margin-right: -1rem;
@include media-breakpoint-up(sm) {
margin-left: 2rem;
margin-right: -2rem;
}
@include media-breakpoint-up(lg) {
margin-right: -6%;
}
@include media-breakpoint-up(xl) {
margin-right: -12.5%;
}
}
*:last-child {
margin-bottom: 0;
}
&[data-bg='black'] {
background: #000;
color: #fff;
}
&[data-bg='yellow'] {
background: #f6e3a1;
}
&[data-bg='pink'] {
background: #f1b5bc;
}
&[data-bg='green'] {
2023-07-05 22:58:08 +00:00
background: #eafff2;
}
&[data-bg='white'] {
background: #fff;
box-shadow: 0 0 0 1px #000;
}
}