Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here.
diff --git a/packages/ckeditor5-image/docs/_snippets/features/image-style-custom.js b/packages/ckeditor5-image/docs/_snippets/features/image-style-presentational.js
similarity index 71%
rename from packages/ckeditor5-image/docs/_snippets/features/image-style-custom.js
rename to packages/ckeditor5-image/docs/_snippets/features/image-style-presentational.js
index 7000f9182c0..16b6f22fef7 100644
--- a/packages/ckeditor5-image/docs/_snippets/features/image-style-custom.js
+++ b/packages/ckeditor5-image/docs/_snippets/features/image-style-presentational.js
@@ -12,17 +12,17 @@ ClassicEditor
removePlugins: [ 'ImageResize', 'LinkImage' ],
image: {
styles: [
- // This option is equal to a situation where no style is applied.
- 'full',
-
- // This represents an image aligned to left.
'alignLeft',
-
- // This represents an image aligned to right.
+ 'alignCenter',
'alignRight'
],
-
- toolbar: [ 'imageTextAlternative', '|', 'imageStyle:alignLeft', 'imageStyle:full', 'imageStyle:alignRight' ]
+ toolbar: [
+ 'imageStyle:alignLeft',
+ 'imageStyle:alignCenter',
+ 'imageStyle:alignRight',
+ '|',
+ 'imageTextAlternative'
+ ]
},
toolbar: {
viewportTopOffset: window.getViewportTopOffsetConfig()
diff --git a/packages/ckeditor5-image/docs/features/image.md b/packages/ckeditor5-image/docs/features/image.md
index f73f29f1e50..ddcc25fb224 100644
--- a/packages/ckeditor5-image/docs/features/image.md
+++ b/packages/ckeditor5-image/docs/features/image.md
@@ -78,17 +78,31 @@ By default, if the image caption is empty, the `` element is not vis
{@snippet features/image-caption}
+## Image upload
+
+See the {@link features/image-upload Image upload} guide.
+
+## Responsive images
+
+Support for responsive images in CKEditor 5 is brought by the {@link features/easy-image Easy Image} feature without any additional configuration. Learn more how to use the feature in your project in the {@link features/easy-image#responsive-images Easy Image integration} guide.
+
## Image styles
In simple integrations it is enough to let the user insert images, set their text alternative and the editor's job is done. An example of such a simple solution are e.g. [GitHub](https://github.com) comments. The styling of the images (for example, their maximum width and margins) is controlled by GitHub through stylesheets.
In more advanced scenarios, the user may need to be able to decide whether the image should take the whole width (if it is the article's main photo) or it should take, for example, 50% of the width and be pulled out of the content (so called "pulled images"). Various integration scenarios require different types of images to be used.
-This is what the {@link module:image/imagestyle~ImageStyle} feature is designed for.
+Finally, in certain situations, the user should be able to granularly control how an image is presented so they should be able to set the size and alignment separately.
-However, unlike in CKEditor 4, in CKEditor 5 the end user does not set the image border, alignment, margins, width, etc. separately. Instead, they can pick one of the styles defined by the developer who prepared the WYSIWYG editor integration. This gives the developer control over how the users style images and makes the user's life easier by setting multiple properties at once.
+The {@link module:image/imagestyle~ImageStyle} feature solves the last two scenarios. The former is handled by so-called ["semantical styles"](#semantical-styles) and the latter by ["presentational styles"](#presentational-styles) in combination with [image resize](#resizing-images).
-A style is applied to the image in form of a class. By default, CKEditor 5 is configured to support two styles: "full width" (which does not apply any class — it is the default style) and "side image" (which applies the `image-style-side` class).
+The available image styles can be configured using the {@link module:image/image~ImageConfig#styles `config.image.styles`} option. Respective buttons should also be added to the image toolbar via {@link module:image/image~ImageConfig#toolbar `config.image.toolbar`}.
+
+### Semantical styles
+
+A semantical style let the user choose from a predefined "types" of images. The user is not able to set the image border, alignment, margins, width, etc. separately. Instead, they can pick one of the styles defined by the developer who prepared the WYSIWYG editor integration. This gives the developer control over how the users style images and makes the user's life easier by setting multiple properties at once.
+
+A style is applied to the image in form of a class. By default, CKEditor 5 is configured to support two default semantical styles: **"full width"** (which does not apply any class — it is the default style) and **"side image"** (which applies the `image-style-side` class).
A normal (full width) image:
@@ -103,37 +117,72 @@ A side image:
```
- The actual styling of the images is the developer's job. CKEditor 5 WYSIWYG editor comes with some default styles, but they will only be applied to images inside the editor. The developer needs to style them appropriately on the target pages.
+ The actual styling of the images is the integrator's job. CKEditor 5 WYSIWYG editor comes with some default styles, but they will only be applied to images inside the editor. The integrator needs to style them appropriately on the target pages.
+
+ You can find the source of the default styles applied by the editor here: [`ckeditor5-image/theme/imagestyle.css`](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-image/theme/imagestyle.css).
- You can find the source of the default styles applied by the editor here: [`ckeditor5-image/theme/imagestyle.css`](https://github.com/ckeditor/ckeditor5-image/blob/master/theme/imagestyle.css).
+ Read more about {@link builds/guides/integration/content-styles styling the content of the editor}.
-Below you can see a demo of the WYSIWYG editor with the image styles feature enabled. The default configuration is used. You can change the styles of images through the image's contextual toolbar.
+Below you can see a demo of the WYSIWYG editor with the semantical image styles. The "full" and "side" styles are the default value of {@link module:image/image~ImageConfig#styles `config.image.styles`} so you do not need to set it.
+
+```js
+ClassicEditor
+ .create( document.querySelector( '#editor' ), {
+ plugins: [ Image, ImageToolbar, ImageCaption, ImageStyle ],
+ image: {
+ toolbar: [
+ 'imageStyle:full',
+ 'imageStyle:side',
+ '|',
+ 'imageTextAlternative'
+ ],
+
+ // The default value,
+ styles: [
+ 'full',
+ 'side'
+ ]
+ }
+ } )
+ .then( ... )
+ .catch( ... );
+```
+
+See the result below. You can change the styles of images through the image's contextual toolbar.
{@snippet features/image-style}
-### Configuring image styles
+
+Try to understand what use cases the system needs to support and define semantic options accordingly. Defining useful and clear styles is one of the steps towards a good user experience and clear, portable output. For example, the "side image" style can be displayed as a floated image on wide screens and as a normal image on low resolution screens (e.g. mobile browsers).
+
+
+
+ While semantical styles can be combined with manual [image resizing](#resizing-images), these features were not designed to be used together.
-The available image styles can be configured using the {@link module:image/image~ImageConfig#styles `image.styles`} option.
+ If you want to enable image resizing, use [presentational image styles](#presentational-styles).
+
+
+### Presentational styles
-The following WYSIWYG editor supports the default full image style plus left- and right-aligned images:
+Presentational styles do not add any special meaning to the content. They directly control the visual aspect of an image.
+
+Currently, the available presentational styles are "align center", "align left" and "align right".
```js
ClassicEditor
.create( document.querySelector( '#editor' ), {
image: {
- // You need to configure the image toolbar, too, so it uses the new style buttons.
- toolbar: [ 'imageTextAlternative', '|', 'imageStyle:alignLeft', 'imageStyle:full', 'imageStyle:alignRight' ],
-
+ // Configure the available styles.
styles: [
- // This option is equal to a situation where no style is applied.
- 'full',
-
- // This represents an image aligned to the left.
- 'alignLeft',
+ 'alignLeft', 'alignCenter', 'alignRight'
+ ],
- // This represents an image aligned to the right.
- 'alignRight'
+ // You need to configure the image toolbar, too, so it shows the new style buttons.
+ toolbar: [
+ 'imageStyle:alignLeft', 'imageStyle:alignCenter', 'imageStyle:alignRight',
+ '|',
+ 'imageTextAlternative'
]
}
} )
@@ -141,15 +190,11 @@ ClassicEditor
.catch( ... );
```
-The code sample above uses predefined image styles: `'full'`, `'alignLeft'` and `'alignRight'`. The latter two apply, respectively, the `.image-style-align-left` and `.image-style-align-right` classes to the `