-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Rich text] Improve list alignment #2185
Conversation
@@ -55,7 +55,7 @@ | |||
or section.settings.show_description | |||
and section.settings.collection.description != empty | |||
-%} | |||
<div class="collection__description {{ section.settings.description_style }}"> | |||
<div class="collection__description {{ section.settings.description_style }} rte"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda similar to my first comment, here we will need to call the component-rte.css
file to be sure the styling is applied.
But maybe we move RTE styles to base.css instead. I'm not sure what's better. Calling multiple assets or having a huge file tbh.
Maybe for now we keep it as is and call that css file from the top of this file. But that could be an asset we load in theme.liquid as rte settings or rte from the admin is most likely on every page of the theme 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm leaning towards calling multiple assets but keeping the base file clean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I'm in favour of keeping things as is for now and just adding the css file to this section. I've added component-rte.css
to the featured collection section here: 7c52fc2
My plan was to improve what we can now as a quick fix/win, then revisit this again when new rte features start to roll in. I agree that we can probably improve things further by moving everything from component-rte.css
to base.css
or as you've suggested, we could just add component-rte.css
to theme.liquid
so that it wouldn't have to be declared in each of those section files. I'll make a note of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are a couple files where we will need to call the component-rte.css
asset:
- collapsible-content.liquid
- image-with-text.liquid
- multicolumn.liquid
- newsletter.liquid
Otherwise everything seemed good 👍
Thanks Ludo. I can see why this was never flagged before (some sections not loading I've added the necessary changes here: 72523a1, all of these sections should now be loading the |
Thank you Andrew, I took a quick quick look and need more time to review.
|
Thanks for taking a look, Melissa.
I see what you mean and I agree that it could be a little closer. Unfortunately, there's currently not many allowable properties that we can use for the
I agree and something else I noticed while working on a potential indentation fix was that it renders differently on Chrome, Firefox, and Safari using the following CSS (subtle but still noticeable): CSS (initial indentation fix)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Let's follow up on the other issue! 🚢
PR Summary
This PR improves the alignment of unordered and ordered
rte
lists.Why are these changes introduced?
Fixes #2155
What approach did you take?
list-style-position: inside;
to.rte ul
and.rte ol
.rte
class to the Featured collection section >collection__description
so that that it would inherit the same alignment.Other considerations
Unordered lists were recently introduced as a new
richtext
feature. I included ordered lists in the event that we add ordered lists to therichtext
input setting. Additionally, accounting for ordered lists now also improves the ordered lists on the product and collection description rich text.Visual impact on existing themes
The alignment of currently used rich text
ul
andol
lists will be improved.Screenshots 🖼️
Rich text section - before
Desktop
Content alignment:
left
Content alignment:
center
Content alignment:
right
Mobile
Content alignment:
left
Content alignment:
center
Content alignment:
right
Rich text section - after
Desktop
Content alignment:
left
Content alignment:
center
Content alignment:
right
Mobile
Content alignment:
left
Content alignment:
center
Content alignment:
right
Testing steps/scenarios 🧪
To help with side-by-side visual comparisons, I'd recommend opening a separate browser window with the latest version of Dawn
main
: https://os2-demo.myshopify.com/admin/themes/127903858710/editormain
richtext
setting. You can also check those sections to visually compare their unordered lists alignmentDemo links 🔗
main
: https://os2-demo.myshopify.com/admin/themes/127903858710/editorChecklist