-
Notifications
You must be signed in to change notification settings - Fork 37
t/134: Various improvements to config.image.styles #140
Conversation
….image.styles with translations, ImageStyleEngine.defaultStyles extension and ImageStyleEngine.defaultIcons support.
… icons in different cases.
…t-full-width icon.
Any chance the default CSS rules for Align right (ok)Align left (could be better)Not sure if it's an issue with ckeditor5-image or related plugins responsible for blockquote/lists. |
For one thing, I could increase the default margin around the images. Then there's the problem with lists and blockquotes that we faced recently. It boils down to |
I'm not sure how far we can go. We can increase margins – that's fine. But can we use OTOH, I'd love if the initial styling was perfect... |
I'm afraid there's nothing we can do. It's overflow, or nothing :/ There's a long discussion on this topic https://stackoverflow.com/questions/710158/why-do-my-list-item-bullets-overlap-floating-elements. |
Hm... OK, seeing this I'm fine with overflow :D |
You mean fine, as long as the text of long paragraphs wrap around the image, right? |
TL;DR: I'd like to propose the following:
Reasoning below. I guess there is no perfect solution. Thinking out loud: in terms of frequency of using semantic block structures I guess the order will be like:
Paragraphs, headingsThere is no issue to solve. ListsBigger margin
Pros: the bullets are visible. Overflow: hiddenPros: the bullets are visible. IMO: bigger margin wins QuotesNo changesBigger margin (to solve issue with lists)Overflow: hidden + bigger margin (to solve issue with lists)Pros: in this case at least shorter quotes look okay. If someone wants to use longer quotes he will have to use either centered/full size image or align it to right, there is no better solution. IMO: Overflow: hidden + bigger margin wins. |
Agree. I didn't think that overflow:hidden will make long list indented on the entire height of them. This is bad for lists, but makes sense for quotes. |
It looks like defining a completely custom style does not work, the
|
@wwalc Does it show up in |
@oleq I modified the manual test in http://localhost:8125/ckeditor5-image/tests/manual/imagestyle.html
With such test, in Firefox in the console I have the following results: Note: I initially reproduced the same issue in a manually created classic build. So I can confirm it using both a build and a modified manual test. |
{ name: 'imageStyleCustom', icon: 'left', className: 'foo-class', title: 'Custom title' }, does not work because it has no |
…better interaction with default list styles.
Doh. It's fine. I have no idea why I missed the value property. I must have copied something that did not contain BTW. Wouldn't it be more intuitive is the default |
TBH, I also find it a little bit confusing that the Do you remember why we decided to go this way, @szymonkups? Can we do anything about this? |
This is implemented this way just to provide a way to configure model value for the style. Looking at this now I think @wwalc opinion has more sense to treat it as some internals that should be hidden from the configurator. Value is stored inside known attribute so I think that it is safe to create value based on style name and/or class name. This will require to mark default style in some different way - currently by setting |
Yup. Good point. Agree with the rest too. |
… #name instead. Defined ImageStyleFormat#isDefault.
src/imagestyle/converters.js
Outdated
@@ -48,7 +48,7 @@ export function modelToViewStyleAttribute( styles ) { | |||
*/ | |||
export function viewToModelStyleAttribute( styles ) { | |||
// Convert only styles without `null` value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the comment still valid here?
I got rid of It also means some fixes in documentation are needed in the ckeditor5 repo https://github.com/ckeditor/ckeditor5/tree/t/ckeditor5-image/134. I also enabled CI in https://github.com/ckeditor/ckeditor5/tree/t/ckeditor5-image/134. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not check the whole PR deeply, but the things that I requested to be corrected seem to work okay now. I'll review and update all the image docs once this PR merged.
@szymonkups Could you review this issue? |
I'd start from the fact that CI for this branch fails :P |
Oopsie – I haven't noticed that this feature requires changes in other pkgs. |
Suggested merge commit message (convention)
Feature: Allowed customization of default image styles. Defined formatting–oriented styles. Simplified
config.image.styles
syntax. Closes ckeditor/ckeditor5#5113. Closes ckeditor/ckeditor5#5114.BREAKING CHANGE: From now on, the
imageStyleFull
usesobject-full-width.svg
icon.Additional information
Requires:
Showcase in http://localhost:8125/ckeditor5-image/tests/manual/imagestyle.html.
Default config:
Customizing just the icon and class in defaults:
Completely custom styles also benefit from translations and default icons: