瀏覽代碼

Move fake table selection color to the :after pseudo element.

panr 5 年之前
父節點
當前提交
bdb3eae33e
共有 1 個文件被更改,包括 14 次插入5 次删除
  1. 14 5
      packages/ckeditor5-theme-lark/theme/ckeditor5-table/tableselection.css

+ 14 - 5
packages/ckeditor5-theme-lark/theme/ckeditor5-table/tableselection.css

@@ -4,19 +4,29 @@
  */
 
 :root {
-	--ck-table-selected-cell-background: hsl(210, 92%, 90%);
+	--ck-table-selected-cell-background: hsla(208, 90%, 80%, .3);
 }
 
 .ck.ck-editor__editable .table table {
 	& td.ck-editor__editable_selected,
 	& th.ck-editor__editable_selected {
-		background-color: var(--ck-table-selected-cell-background) !important;
-
+		position: relative;
 		caret-color: transparent;
 		outline: unset;
 		box-shadow: unset;
 
-		& ::selection {
+		&:after {
+			content: '';
+			background-color: var(--ck-table-selected-cell-background);
+			position: absolute;
+    	top: 0;
+    	left: 0;
+    	right: 0;
+    	bottom: 0;
+		}
+
+		& ::selection,
+		&:focus {
 			background-color: transparent;
 		}
 
@@ -25,4 +35,3 @@
 		}
 	}
 }
-