Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Image placeholder styling #64

Merged
merged 5 commits into from
Oct 2, 2017
Merged

Image placeholder styling #64

merged 5 commits into from
Oct 2, 2017

Conversation

szymonkups
Copy link
Contributor

@szymonkups szymonkups commented Oct 2, 2017

Suggested merge commit message (convention)

Other: Placeholder image looks better on wider editors. Closes ckeditor/ckeditor5#2827 .

@szymonkups szymonkups requested review from Reinmar and pjasiun October 2, 2017 10:52
@Reinmar Reinmar requested a review from oleq October 2, 2017 10:54
@Reinmar
Copy link
Member

Reinmar commented Oct 2, 2017

And what's the current result?

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 250">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do those changes do?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the ticket description:

We should also create placeholder that have different width/height ratio to not take as much vertical space when it will be on 100% of the width.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change the file to optimized one.

@@ -73,7 +73,7 @@ export default class ImageUploadProgress extends Plugin {

// Show placeholder with infinite progress bar on the top while image is read from disk.
if ( status == 'reading' ) {
viewFigure.addClass( 'ck-appear', 'ck-infinite-progress' );
viewFigure.addClass( 'ck-appear', 'ck-infinite-progress', 'ck-placeholder' );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why adding this class?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see now how this class is used, but I got confused because we already use ck-placeholder but in a different case.

I think that what's wrong here is that those class names don't use BEM convention. E.g. this is image placeholder so it should contain some "image" part. Am I right, @oleq?

Copy link

@pjasiun pjasiun Oct 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ck-image-placeholder would be fine?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is added to make sure that placeholder is always 100% width when is visible.

Copy link
Member

@oleq oleq Oct 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be ck-image-upload-placeholder (if there's no ck-image-upload parent element).

What does ck-infinite-progress do? It should rather be ck-image-upload-progress_infinite (as opposed to hypothetical ck-image-upload-progress_finite). Or, if the "progress" is the name of the modifier, then ck-image-upload_progress_infinite.

ck-appear doesn't feel good either. It also belongs to the image upload ecosystem, so it should be at least ck-image-upload_appear.

We've got a guide for this https://github.com/ckeditor/ckeditor5-design/wiki/Code-Style-Naming-Guidelines#css-classes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see now how this class is used, but I got confused because we already use ck-placeholder but in a different case.

I agree that this class should be named better. I totally forgot about it's other usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will use ck-image-upload-placeholder as @oleq recommends it. I will create separate ticket to clear the class naming mess.

@szymonkups
Copy link
Contributor Author

This is how placeholder looks now on wider editors:
image

vs

image

@oleq
Copy link
Member

oleq commented Oct 2, 2017

I think the "Uploading Image" text should be rendered with a non-serif font, like the rest of the UI –
it's a part of the UI, not the content.

#7E8A97 text color is enough to match WCAG AA for large text.

@oleq
Copy link
Member

oleq commented Oct 2, 2017

The color of the text also fails in terms of a11y standards:

image

@oleq
Copy link
Member

oleq commented Oct 2, 2017

Off-topic: I wish one day we can implement an UI similar to my mockups in https://github.com/ckeditor/ckeditor5-image/issues/16#issuecomment-279640113.

@szymonkups
Copy link
Contributor Author

Fixed font and contrast:
image

@pjasiun pjasiun merged commit edb5e81 into master Oct 2, 2017
@pjasiun pjasiun deleted the t/63 branch October 2, 2017 13:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image placeholder should look better on wider editor
4 participants