8
0
Просмотр исходного кода

Refactored widget CSS styles to allow easier customization with SASS variables.

Aleksander Nowodzinski 8 лет назад
Родитель
Сommit
3d0e8b97dd
1 измененных файлов с 13 добавлено и 9 удалено
  1. 13 9
      packages/ckeditor5-widget/theme/theme.scss

+ 13 - 9
packages/ckeditor5-widget/theme/theme.scss

@@ -6,36 +6,40 @@
 @import '~@ckeditor/ckeditor5-theme-lark/theme/helpers/states';
 @import '~@ckeditor/ckeditor5-theme-lark/theme/helpers/spacing';
 
+$widget-outline-thickness: 3px;
+
 @include ck-color-add( (
-	'widget-blurred': #ddd,
-	'widget-hover': #FFD25C
+	'widget-border-blurred': #ddd,
+	'widget-border-hover': #FFD25C,
+	'widget-editable-focused-background': $ck-color-background,
 ) );
 
-$widget-outline-thickness: 3px;
-
 .ck-widget {
 	margin: ck-spacing() 0;
 	padding: 0;
 
 	&.ck-widget_selected, &.ck-widget_selected:hover {
-		outline: $widget-outline-thickness solid ck-color( 'focus' );
+		outline: $widget-outline-thickness solid ck-color( 'border-focus' );
 	}
 
 	.ck-editor__editable.ck-blurred &.ck-widget_selected {
-		outline: $widget-outline-thickness solid ck-color( 'widget-blurred' );
+		outline: $widget-outline-thickness solid ck-color( 'widget-border-blurred' );
 	}
 
 	&:hover {
-		outline: $widget-outline-thickness solid ck-color( 'widget-hover' );
+		outline: $widget-outline-thickness solid ck-color( 'widget-border-hover' );
 	}
 
 	.ck-editable {
+		border: 1px solid transparent;
+
 		// The `:focus` style is applied before `.ck-editable_focused` class is rendered in the view.
 		// These styles show a different border for a blink of an eye, so `:focus` need to have same styles applied.
 		&.ck-editable_focused, &:focus {
-			@include ck-focus-ring( 'outline' );
+			@include ck-focus-ring();
 			@include ck-box-shadow( $ck-inner-shadow );
-			background-color: ck-color( 'background' );
+
+			background-color: ck-color( 'widget-editable-focused-background' );
 		}
 	}
 }