Przeglądaj źródła

Improve marker on text link color.

Maciej Gołaszewski 5 lat temu
rodzic
commit
2bdbfde045

+ 11 - 3
packages/ckeditor5-link/src/linkui.js

@@ -377,6 +377,12 @@ export default class LinkUI extends Plugin {
 			// Because the form has an input which has focus, the focus must be brought back
 			// to the editor. Otherwise, it would be lost.
 			this.editor.editing.view.focus();
+
+			if ( this.editor.model.markers.has( 'link-ui' ) ) {
+				this.editor.model.change( writer => {
+					writer.removeMarker( 'link-ui' );
+				} );
+			}
 		}
 	}
 
@@ -454,9 +460,11 @@ export default class LinkUI extends Plugin {
 		// Then remove the actions view because it's beneath the form.
 		this._balloon.remove( this.actionsView );
 
-		editor.model.change( writer => {
-			writer.removeMarker( 'link-ui' );
-		} );
+		if ( editor.model.markers.has( 'link-ui' ) ) {
+			editor.model.change( writer => {
+				writer.removeMarker( 'link-ui' );
+			} );
+		}
 	}
 
 	/**

+ 2 - 2
packages/ckeditor5-theme-lark/theme/ckeditor5-link/link.css

@@ -9,9 +9,9 @@
 }
 
 .ck .ck-link-text-selection_collapsed {
-	border: 1px solid var(--ck-color-link-selected-background);
+	border: 1px solid var(--ck-color-link-text-selection);
 }
 
 .ck .ck-link_selected {
-	background: var(--ck-color-link-selected-background);
+	background: var(--ck-color-link-text-selection);
 }

+ 2 - 1
packages/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_colors.css

@@ -106,5 +106,6 @@
 	/* -- Link -------------------------------------------------------------------------------- */
 
 	--ck-color-link-default:									hsl(240, 100%, 47%);
-	--ck-color-link-selected-background: 						hsla(201, 100%, 56%, 0.1);
+	--ck-color-link-selected-background:						hsla(201, 100%, 56%, 0.1);
+	--ck-color-link-text-selection:								hsla(201, 100%, 56%, 0.3);
 }