From 56e6709ae80052afb3754073ec9cd723c63ca0db Mon Sep 17 00:00:00 2001
From: Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de>
Date: Tue, 20 Feb 2024 08:49:52 +0000
Subject: [PATCH] replace .ckplaceholder (cke4) with .ck.ck-editor, fixes #3758

Closes #3758

Merge request studip/studip!2628
---
 .../scss/courseware/blocks/text.scss          |  4 ----
 resources/assets/stylesheets/scss/forms.scss  | 16 +++++++++++++++-
 .../stylesheets/scss/studip-cke-ui.scss       | 19 -------------------
 3 files changed, 15 insertions(+), 24 deletions(-)

diff --git a/resources/assets/stylesheets/scss/courseware/blocks/text.scss b/resources/assets/stylesheets/scss/courseware/blocks/text.scss
index 6bb182429a0..da943da16dc 100644
--- a/resources/assets/stylesheets/scss/courseware/blocks/text.scss
+++ b/resources/assets/stylesheets/scss/courseware/blocks/text.scss
@@ -9,8 +9,4 @@
     .cke {
         width: 100% !important;
     }
-
-    .ckplaceholder {
-        height: 0 !important;
-    }
 }
diff --git a/resources/assets/stylesheets/scss/forms.scss b/resources/assets/stylesheets/scss/forms.scss
index fc3eb4b41f5..8c5682462f3 100644
--- a/resources/assets/stylesheets/scss/forms.scss
+++ b/resources/assets/stylesheets/scss/forms.scss
@@ -70,6 +70,10 @@ form.default {
         }
     }
 
+    .ck-source-editing-area textarea {
+        max-width: unset;
+    }
+
     input[list] {
         @include background-icon(arr_1down, clickable);
 
@@ -80,6 +84,12 @@ form.default {
 
     textarea:not(.size-l) + .ck-editor {
         max-width: $max-width-m;
+
+        .ck-toolbar__grouped-dropdown {
+            .ck-toolbar {
+                max-width: calc($max-width-m - 2px);
+            }
+        }
     }
 
     .quicksearch_container {
@@ -107,7 +117,7 @@ form.default {
 
         input[type=date], input[type=email], input[type=number],
         input[type=password], input[type=text], input[type=time], input[type=tel], input[type=url],
-        textarea, select, .ckplaceholder {
+        textarea, select, .ck.ck-editor {
             display: block;
             margin-top: 0.5ex;
         }
@@ -115,6 +125,10 @@ form.default {
         .ck-editor {
             text-indent: initial;
         }
+
+        .ck-source-editing-area textarea {
+            margin-top: 0;
+        }
     }
 
     .formpart {
diff --git a/resources/assets/stylesheets/scss/studip-cke-ui.scss b/resources/assets/stylesheets/scss/studip-cke-ui.scss
index 883858d08c8..750a35b2d4d 100644
--- a/resources/assets/stylesheets/scss/studip-cke-ui.scss
+++ b/resources/assets/stylesheets/scss/studip-cke-ui.scss
@@ -65,9 +65,6 @@
     --ck-color-tooltip-text: var(--color-text);
 }
 
-.ck.ck-editor {
-    margin-top: 0.5ex;
-}
 .ck.ck-icon, .ck.ck-icon * {
     color: var(--base-color);
 }
@@ -384,14 +381,6 @@ $editor-min-height: 8em;
     min-height: $editor-min-height;
 }
 
-form.default label:not(.undecorated):not(.ck-voice-label) .ck-source-editing-area textarea {
-    margin-top: 0;
-}
-
-form.default .ck-source-editing-area textarea {
-    max-width: unset;
-}
-
 /* forum fixes */
 #forum .ck-source-editing-area textarea {
     height: 100%;
@@ -419,14 +408,6 @@ form.default .ck-source-editing-area textarea {
     }
 }
 
-form.default textarea:not(.size-l) + .ck-editor {
-    .ck-toolbar__grouped-dropdown {
-        .ck-toolbar {
-            max-width: calc(48em - 2px);
-        }
-    }
-}
-
 /* balloon editor button*/
 .ck.ck-block-toolbar-button {
     background-color: var(--dark-gray-color-5);
-- 
GitLab