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

Clear rte page content #128

Merged
merged 3 commits into from
Jul 7, 2021
Merged

Clear rte page content #128

merged 3 commits into from
Jul 7, 2021

Conversation

kmeleta
Copy link
Contributor

@kmeleta kmeleta commented Jul 6, 2021

Why are these changes introduced?

Fixes #2

What approach did you take?

Added a clearfix (via :after) to the rte class. Right aligned media in the page content rte gets float: right. If that content isn't cleared by something else in that page, the content can bleed out of its container and/or cause other layout issues (i.e. collapsible tabs on the product page).

Other considerations

The original issue was scoped for page content within collapsible tabs on product pages, but really this same sort of issue could apply anywhere RTE page content can be displayed.

Demo links

Checklist

@kmeleta kmeleta marked this pull request as ready for review July 6, 2021 17:47
@ludoboludo ludoboludo assigned ludoboludo and unassigned ludoboludo Jul 6, 2021
Comment on lines 251 to 255
.product__accordion .accordion__content:after {
clear: both;
content: "";
display: block;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you're right in your description. It would need to be added for the .rte class I think. Cause if you go on the home page or anywhere else you can add a section, then add a page section and use page with floated image then you will get the same issue:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, that will come up more often then. Moved the same fix to the rte class now. I can't think of a reason why this wouldn't be ok, but maybe there's a rte case out there I'm not thinking of. Curious if anyone thinks there's a safer way to handle this.

Copy link
Contributor

@ludoboludo ludoboludo Jul 6, 2021

Choose a reason for hiding this comment

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

I guess we could have a rte-page specific class but I don't think having it to the more general rte one should create any problems. It's adding content in places where it might not be needed so maybe we should avoid it, to keep things clean 🤔 what do you think ?

I think there are basically three places where it might be needed, the main page, the page section and on the product page for the collapsible tab and for the popup which both have a page picker.

Copy link
Contributor

@tyleralsbury tyleralsbury Jul 7, 2021

Choose a reason for hiding this comment

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

I think it should be fine. Since the content is empty, it'll just be a 0 height pseudo-element on the page.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also I haven't seen a clearfix in a long time. This brings me back!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I'm ok with the content as is. I'll leave it simple as is if you don't have a strong objection Ludo

@kmeleta kmeleta changed the title Clear collapsible tab content Clear rte page content Jul 6, 2021
@kmeleta kmeleta requested a review from bertiful July 6, 2021 20:26
@tauthomas01 tauthomas01 self-assigned this Jul 7, 2021
@tauthomas01 tauthomas01 self-requested a review July 7, 2021 17:39
Copy link
Contributor

@tauthomas01 tauthomas01 left a comment

Choose a reason for hiding this comment

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

Works well. Tested on:

  • Product page: page content
  • Page section
  • Page template

On Chrome/Firefox/Safari, no issues.

I don't think this will break in the future, since we're not really using float anymore unless it's RTE or an app is using it, but that's a separate topic.

assets/component-rte.css Outdated Show resolved Hide resolved
Co-authored-by: Chris Berthe <chris.berthe@shopify.com>
@kmeleta kmeleta merged commit 7a6bda8 into main Jul 7, 2021
@kmeleta kmeleta deleted the tab-page-content-fix branch July 7, 2021 19:22
phapsidesGT pushed a commit to Gravytrain-UK/gt-shopify-dawn-theme that referenced this pull request Sep 3, 2024
* clear collapsible tab content

* apply clear fix to rte class

* Update single quote

Co-authored-by: Chris Berthe <chris.berthe@shopify.com>

Co-authored-by: Chris Berthe <chris.berthe@shopify.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Collapsible Tab: Page content is not contained within tab container.
5 participants