-
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
Add padding controls to the announcement bar #1789
base: main
Are you sure you want to change the base?
Conversation
@@ -1,12 +1,26 @@ | |||
{%- for block in section.blocks -%} | |||
{%- case block.type -%} | |||
{%- when 'announcement' -%} | |||
{%- style -%} |
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 not totally sure about this part — it seems weird to declare this inline here, but that appears to be how it's handled for the other sections examples I've seen? I might be misinterpreting...
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.
Yeah you're right with that approach 👍
Because we're looping through blocks and they each need their own styling, it makes sense to do it here and the way you did.
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 could be an approach maybe using CSS custom properties 🤔
Having a general declaration referencing a custom property which is different/updated per blocks.
But I wonder if it would be beneficial. It could prevent outputting the whole declaration for every block but it's not like merchant use 27 announcement bars.
sections/announcement-bar.liquid
Outdated
}, | ||
{ | ||
"type": "header", | ||
"content": "t:sections.all.padding.section_padding_heading" |
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.
This is "Section Padding" — I'm not sure if we need to declare a new string for "Block Padding" instead.
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 kinda feel like it would either need to be named differently or only apply to the container/section for now.
Otherwise it's introducing a pattern that doesn't quite match the rest.
We could have a look at offering that same option of padding on blocks but across 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.
Thanks. I've moved these strings to be block-specific in f83ebdc. Let me know if you think that's a better solution for right now.
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.
@@ -1,12 +1,26 @@ | |||
{%- for block in section.blocks -%} | |||
{%- case block.type -%} | |||
{%- when 'announcement' -%} | |||
{%- style -%} |
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.
Yeah you're right with that approach 👍
Because we're looping through blocks and they each need their own styling, it makes sense to do it here and the way you did.
@@ -1,12 +1,26 @@ | |||
{%- for block in section.blocks -%} | |||
{%- case block.type -%} | |||
{%- when 'announcement' -%} | |||
{%- style -%} |
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 could be an approach maybe using CSS custom properties 🤔
Having a general declaration referencing a custom property which is different/updated per blocks.
But I wonder if it would be beneficial. It could prevent outputting the whole declaration for every block but it's not like merchant use 27 announcement bars.
sections/announcement-bar.liquid
Outdated
}, | ||
{ | ||
"type": "header", | ||
"content": "t:sections.all.padding.section_padding_heading" |
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 kinda feel like it would either need to be named differently or only apply to the container/section for now.
Otherwise it's introducing a pattern that doesn't quite match the rest.
We could have a look at offering that same option of padding on blocks but across 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.
Looks good, I would just tweak the translation part and then we can request translations 👍
sections/announcement-bar.liquid
Outdated
"label": "t:sections.announcement-bar.blocks.announcement.settings.padding.padding_top", | ||
"default": 10 | ||
}, | ||
{ | ||
"type": "range", | ||
"id": "padding_bottom", | ||
"min": 0, | ||
"max": 100, | ||
"step": 2, | ||
"unit": "px", | ||
"label": "t:sections.announcement-bar.blocks.announcement.settings.padding.padding_bottom", |
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 you can go back to what you had before here so: t:sections.all.padding.padding_top
and t:sections.all.padding.padding_bottom
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.
Cool, thanks! Should be all set now and ready for a re-review.
This reverts commit f83ebdc.
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.
Looking good 👍 Ill request translations and re approve when they're all back in
We have received a translation request but there is a question blocking translation work. Your help is needed. Click the following links to answer the questions
Not your issue?Forward the issue to someone with more context; please don't leave this pending. 🙏 Questions?Hop in the #help-i18n-and-translation Slack channel. |
This reverts commit 000c23b.
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.
👌
Hey team, The probot-CLA was recently deprecated and replaced with the shopify-cla action. To successfully use the new shopify-cla status check, this PR will be closed and reopened. Thanks and sorry for the minor inconvenience. Message me if you have any questions 😄 Please refer to the following for more information: |
@@ -360,6 +360,7 @@ | |||
"sections": { | |||
"all": { | |||
"padding": { | |||
"block_padding_heading": "Block padding", |
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.
Localization quality issue found
The following issues may affect the quality of localized translations if they are not addressed:
- The value
Block padding
for keysections.all.padding.block_padding_heading
is very short. Short strings are more likely to be misunderstood by translators without context. Please provide additional context for the translators if possible.
Please look out for other instances of this issue in your PR and fix them as well if possible.
Questions about these messages? Hop in the #help-localization Slack channel.
PR Summary:
Adds padding controls to the announcement bar block.
Why are these changes introduced?
Greater design flexibility.
What approach did you take?
This mirrors the approach taken for padding controls on sections (e.g. Rich Text).
Other considerations
rem
values, and it feels a little weird to move that back to pixel values. We could userem
values in the slider, but I don't believe we do that anywhere else.Testing steps/scenarios
Checklist