// Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. // For licensing, see LICENSE.md or http://ckeditor.com/license @import '~@ckeditor/ckeditor5-theme-lark/theme/helpers/_spacing'; $ck-image-spacing: 5 * ck-spacing( 'small' ); $ck-image-max-width: 50%; .ck-editor__editable { .image { text-align: center; clear: both; &.image-style-side, &.image-style-align-left, &.image-style-align-center, &.image-style-align-right { max-width: $ck-image-max-width; } &.image-style-side { float: right; margin-left: $ck-image-spacing; } &.image-style-align-left { float: left; margin-right: $ck-image-spacing; } &.image-style-align-center { margin-left: auto; margin-right: auto; } &.image-style-align-right { float: right; margin-left: $ck-image-spacing; } } .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; // Make sure the image never exceeds the size of the parent container (#67). max-width: 100%; } }