Skip to content

Fix margin for right-aligned images#398

Merged
JoelMarcey merged 2 commits intofacebook:masterfrom
rickhanlonii:rh-fix-image-margin
Jan 18, 2018
Merged

Fix margin for right-aligned images#398
JoelMarcey merged 2 commits intofacebook:masterfrom
rickhanlonii:rh-fix-image-margin

Conversation

@rickhanlonii
Copy link
Copy Markdown
Member

@rickhanlonii rickhanlonii commented Jan 13, 2018

Motivation

@cyan33 found this bug and submitted it to the Jest repo, I thought I'd put in a quick fix

Closes jestjs/jest#5299
Closes #397

Test Plan

Tested using the website/ within this project

Before:

After:

@rickhanlonii
Copy link
Copy Markdown
Member Author

rickhanlonii commented Jan 13, 2018

Sorry @cyan33, just saw #397, didn't mean to step on your toes 😔

@cyan33
Copy link
Copy Markdown

cyan33 commented Jan 14, 2018

@rickhanlonii It's alright! Happy to see this get fixed! 😄

@cyan33
Copy link
Copy Markdown

cyan33 commented Jan 14, 2018

On second thought tho, I think it's better to separate the imageAlignSide into imageAlignLeft and imageAlignRight. Because it seems that only adding an imageAlignRight makes the logic across those two components somewhat duplicated and not that intuitive.

@rickhanlonii
Copy link
Copy Markdown
Member Author

I had the same thought, I'll update

@rickhanlonii
Copy link
Copy Markdown
Member Author

Updated, that's much cleaner thanks @cyan33

@JoelMarcey
Copy link
Copy Markdown
Contributor

@rickhanlonii Thank you so much for taking the time to fix this. Looks good to me.

And thanks @cyan33 for raising the issue too.

@cyan33
Copy link
Copy Markdown

cyan33 commented Jan 18, 2018

@JoelMarcey No problem! 😄

Copy link
Copy Markdown
Contributor

@JoelMarcey JoelMarcey left a comment

Choose a reason for hiding this comment

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

Looks great.

At first I thought about whether imageAlignSide is actually necessary (not taking into consideration it would be a breaking change if we took it out). But I think it works like this.

@JoelMarcey JoelMarcey merged commit 4c2558e into facebook:master Jan 18, 2018
@rickhanlonii rickhanlonii deleted the rh-fix-image-margin branch January 18, 2018 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The imgAlignSide component only has a margin-right Website: Wrong Margin for the BlockImage

4 participants