Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Fix comment preview spacing #573

Merged
merged 8 commits into from
May 9, 2022
Merged

Conversation

bryophyta
Copy link
Contributor

@bryophyta bryophyta commented May 9, 2022

What does this change?

It adds bottom margin to paragraph tags.

Why?

This makes the styling in comment previews more consistent with the styling of submitted comments. This should address the first part of this issue.

Screenshots

(From storybook)

Before in Prod Before in storybook After in storybook
Before in prod Before in storybook After in storybook

Previously, the storybook rendering of comment previews didn't match the production site, because the dotcom site applies reset styles which weren't being applied in storybook. This PR adds the reset styles (globally, merging #572) and also adds spacing to the preview comments. So there shouldn't be much visual change in the storybook itself, but the storybook should now match dotcom.

bryophyta and others added 5 commits May 9, 2022 09:09
- Add bottom margin to <p> tags in comment previews
- <p> -> <div> for preview wrapper
- change spout from a separate div to a ::before pseudo-elem

Co-authored-by: Max Duval <[email protected]>
@bryophyta bryophyta requested a review from oliverlloyd as a code owner May 9, 2022 10:51
@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2022

Size Change: +219 B (0%)

Total Size: 218 kB

Filename Size Change
build/App.esm.js 109 kB +118 B (0%)
build/App.js 109 kB +101 B (0%)

compressed-size-action

Copy link

@jlieb10 jlieb10 left a comment

Choose a reason for hiding this comment

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

LGTM - just wondering where the padding and width figures come from?

@bryophyta
Copy link
Contributor Author

LGTM - just wondering where the padding and width figures come from?

The ones in the story components? I took them from the stories for CommentBlockComponents, where there was already the padding, and then Oliver suggested adding a width: https://github.com/guardian/dotcom-rendering/pull/4838/files#r866602666

I thought these seemed fairly appropriate here too, but to be honest I didn't give it too much thought, so happy to adapt if you think it suitable 👍

Copy link
Contributor

@oliverlloyd oliverlloyd left a comment

Choose a reason for hiding this comment

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

Nice 👍

@bryophyta
Copy link
Contributor Author

Thanks! I'll merge now.

@oliverlloyd, I don't think I have the required permissions to publish the package to npm. I'm not sure how often we release updates to the package, but I'd be interested in going through the publishing process with someone next time it's released.

@bryophyta bryophyta merged commit d034c4a into main May 9, 2022
@bryophyta bryophyta deleted the pf/fix-comment-preview-spacing branch May 9, 2022 17:12
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.

3 participants