8
0
Pārlūkot izejas kodu

Merge branch 'master' into t/77

Piotrek Koszuliński 8 gadi atpakaļ
vecāks
revīzija
f25a6f5798

+ 6 - 4
packages/ckeditor5-image/theme/imagecaption/theme.scss

@@ -2,12 +2,14 @@
 // For licensing, see LICENSE.md or http://ckeditor.com/license
 
 @import '~@ckeditor/ckeditor5-theme-lark/theme/helpers/_colors.scss';
+@import '~@ckeditor/ckeditor5-theme-lark/theme/helpers/_spacing.scss';
+@import '~@ckeditor/ckeditor5-theme-lark/theme/helpers/_fonts.scss';
 
-.ck-widget.image {
-	figcaption.ck-editable {
+.ck-editor__editable {
+	.image > figcaption {
 		background-color: ck-color( 'foreground' );
-		padding: 10px;
-		font-size: .8em;
+		padding: ck-spacing();
+		font-size: ck-font-size( -1 );
 		color: ck-color( 'text', 40 );
 	}
 }

+ 17 - 16
packages/ckeditor5-image/theme/theme.scss

@@ -1,25 +1,26 @@
 // Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
 // For licensing, see LICENSE.md or http://ckeditor.com/license
 
-// Image widget's styles.
-.image {
-	text-align: center;
-	clear: both;
+.ck-editor__editable {
+	.image {
+		text-align: center;
+		clear: both;
 
-	&.image-style-side {
-		float: right;
-		margin-left: 0.8em;
-		max-width: 50%;
+		&.image-style-side {
+			float: right;
+			margin-left: 0.8em;
+			max-width: 50%;
+		}
 	}
-}
 
-.image > img {
-	// Prevent unnecessary margins caused by line-height (see #44).
-	display: block;
+	.image > img {
+		// Prevent unnecessary margins caused by line-height (see #44).
+		display: block;
 
-	// Center the image if its width is smaller than content's width.
-	margin: 0 auto;
+		// Center the image if its width is smaller than content's width.
+		margin: 0 auto;
 
-	// Make sure the image never exceeds the size of the parent container (#67).
-	max-width: 100%;
+		// Make sure the image never exceeds the size of the parent container (#67).
+		max-width: 100%;
+	}
 }

+ 18 - 14
packages/ckeditor5-image/theme/widget/theme.scss

@@ -4,34 +4,38 @@
 @import '~@ckeditor/ckeditor5-theme-lark/theme/helpers/_colors.scss';
 @import '~@ckeditor/ckeditor5-theme-lark/theme/helpers/_shadow.scss';
 @import '~@ckeditor/ckeditor5-theme-lark/theme/helpers/_states.scss';
+@import '~@ckeditor/ckeditor5-theme-lark/theme/helpers/_spacing.scss';
+
+@include ck-color-add( (
+	'widget-blurred': #ddd,
+	'widget-hover': yellow
+) );
+
+$widget-outline-thickness: 2px;
 
 .ck-widget {
-	margin: 10px 0;
+	margin: ck-spacing() 0;
 	padding: 0;
 
 	&.ck-widget_selected, &.ck-widget_selected:hover {
-		outline: 2px solid #ace;
+		outline: $widget-outline-thickness solid ck-color( 'focus' );
 	}
 
 	.ck-editor__editable.ck-blurred &.ck-widget_selected {
-		outline: 2px solid #ddd;
+		outline: $widget-outline-thickness solid ck-color( 'widget-blurred' );
 	}
 
 	&:hover {
-		outline: 2px solid yellow;
+		outline: $widget-outline-thickness solid ck-color( 'widget-hover' );
 	}
 
 	.ck-editable {
-		// The `:focus` styles is applied before `.focused` class inside editables.
-		// These styles show different border for a blink of an eye.
-		&:focus {
-			&.ck-editable_focused {
-				@include ck-focus-ring( 'outline' );
-				@include ck-box-shadow( $ck-inner-shadow );
-				background-color: ck-color( 'background' );;
-			}
-			outline: none;
-			box-shadow: none;
+		// 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-box-shadow( $ck-inner-shadow );
+			background-color: ck-color( 'background' );
 		}
 	}
 }