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

Varia: Manually resized image become centred align on front of site #1407

Closed
iamtakashi opened this issue Sep 6, 2019 · 6 comments · Fixed by #1463
Closed

Varia: Manually resized image become centred align on front of site #1407

iamtakashi opened this issue Sep 6, 2019 · 6 comments · Fixed by #1463
Assignees
Labels
[Theme] Varia [Type] Bug Something isn't working

Comments

@iamtakashi
Copy link
Contributor

iamtakashi commented Sep 6, 2019

Originally reported here: Automattic/wp-calypso#36026 (comment)

Image is left aligned if you don't set the alignment both in the editor and on the front of the site.

Screen Shot 2019-09-06 at 16 06 06

But if we manually resize the image, it becomes centre aligned, because the width of the figure becomes the size of the image.

Screen Shot 2019-09-06 at 20 06 56

We'll need to exclude this from the rue that adds auto margins to the sides.

.entry-content > *:not(... {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@iamtakashi iamtakashi added [Type] Bug Something isn't working [Theme] Varia labels Sep 6, 2019
@iamtakashi iamtakashi changed the title Varia: Resized image become centred align on front of site Varia: Manually resized image become centred align on front of site Sep 6, 2019
@Copons
Copy link
Contributor

Copons commented Sep 20, 2019

Just copying the gif I've posted in the other PR that could make it clearer of what's happening:

Sep-06-2019 16-26-39

@allancole
Copy link
Contributor

This seems somewhat related to #1414. We can probably fix both in one PR.

@allancole allancole self-assigned this Sep 25, 2019
@iamtakashi iamtakashi self-assigned this Sep 27, 2019
@iamtakashi
Copy link
Contributor Author

iamtakashi commented Sep 27, 2019

I looked into this issue, but it's trickier than I thought.

Image block changes the display behaviour of a resized image to table which changes the width of the block.

@iamtakashi
Copy link
Contributor Author

Image block changes the display behaviour of a resized image to table which changes the width of the block.

This approach has been in question before: WordPress/gutenberg#13684 In my opinion, this makes difficult to work with.

I'm not sure what we can do about it. @allancole any thought?

@allancole
Copy link
Contributor

@iamtakashi Yeah, I think we may need to punt this one, unfortunately. Based on the comment here, any fix we apply in Varia will likely conflict with the true fix which needs to happen in core first.

@iamtakashi
Copy link
Contributor Author

@allancole But the disparity in alignment between the editor and the front-end concerns me.

Screen Shot 2019-09-28 at 16 48 26

I wonder if Varia should make images centred align as default until a user specifies alignment for it. The position of the caption suggests that as well.

Screen Shot 2019-09-28 at 16 55 38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Theme] Varia [Type] Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants