Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UX] CKEditor/Rich text editor image sizing needs to be optional. #2010

Open
Graham-72 opened this issue Jul 6, 2016 · 3 comments
Open

[UX] CKEditor/Rich text editor image sizing needs to be optional. #2010

Graham-72 opened this issue Jul 6, 2016 · 3 comments

Comments

@Graham-72
Copy link

Graham-72 commented Jul 6, 2016

createpage
When saving content that includes an image, CKEditor adds in the width and height parameters. But if I want my image size to be responsive, I need to omit these in order to apply styles with the style sheet.

I note that using the unofficial contrib module CKEditor Addon fixes this problem and others.

One more issue to add to the META? #1087 CKEditor/Rich text editor follow ups.

@Dinornis
Copy link

👍 on this.

In addition to your use case example I found that most users struggle with the Image size fields.

Maybe the image sizing can be replaced with the option of selecting an Image style predefined in /admin/config/media/image-styles ?

@jenlampton jenlampton changed the title CKEditor/Rich text editor image sizing needs to be optional. [UX] CKEditor/Rich text editor image sizing needs to be optional. Apr 27, 2017
@jenlampton
Copy link
Member

jenlampton commented Apr 27, 2017

I want my image size to be responsive, I need to omit these in order to apply styles with the style sheet.

Anything you put in your stylesheet will override inline width and height attributes on an image tag. It's only when they are specified as a style attribute that this becomes a problem. Can you verify what the markup is for your rendered HTML on that image?

IIRC style attributes on anything should be removed by the filter system, so I don't think that's likely what's going on here (unless your ckeditor is enabled for the HTML code input format).

From a user-experience perspective, I agree that width & height fields should be optional in the form, I expect most of the time people will prefer to click/drag/resize. However, we also should check if HTML will still be considered valid without width and height attributes on the img tag -- I have a foggy memory of that being a problem.

@quicksketch
Copy link
Member

However, we also should check if HTML will still be considered valid without width and height attributes on the img tag -- I have a foggy memory of that being a problem.

<img> height and width are optional, but having them specified as the actual image size helps the browser render the page quicker, because it doesn't need to load the image to know how large a space it will take up. CSS always wins over the height/width parameters of the image itself.

Maybe the image sizing can be replaced with the option of selecting an Image style predefined in /admin/config/media/image-styles ?

I think such a request is different yet from this issue. I made a new issue at #2658.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

4 participants