-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Query Loop Block: make elements wrap and use 'gap' instead of 'margin-right' for 'post-template' #36832
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @shadigaafar! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
remove extra newline Co-authored-by: Zebulan Stanphill <[email protected]>
I am thinking it might be helpful if @ntsekouras and @aaronrobertshaw are able to take a closer look at this PR. |
There are some ongoing efforts aimed at improving the Query Loop Block being tracked in #30910. I think control over the spacing for the Query Loop Block might be a good candidate for the new block gap support. Perhaps @andrewserong has some thoughts on how easily that might be adopted here? |
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 for submitting the PR @shadigaafar!
I gave this a quick test, but I wasn't quite sure what the existing issue is that we're trying to resolve here (unfortunately the MP4 file didn't play for me). It looks like this changeset updates the post template so that in all viewports less than 1080px
the column count is dynamic (that is, relying on flex to manage how many columns appear). Do you mind updating the PR description to include an example of the problem you're trying to solve?
Unfortunately, the change in this PR seems to override a user setting for column count when folks want to set a lower number of columns (e.g. 2 or 3), and so could affect layouts that are already out in the wild.
I was wondering if this wrap behaviour might be better suited to a block style? I'll just add the Needs design feedback label to this PR, as some designers might have a better idea of the expected behaviour for this block.
Thanks again for submitting the change, and congrats on opening your first Gutenberg PR!
margin-right: 1.25em; | ||
} | ||
|
||
@include break-xlarge { |
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 change effectively switches off the column count for all viewport widths less than 1080px, so if someone has set their Query Loop block to a column count of 2
for example, then in narrower viewports, 3 or 4 columns will be displayed 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.
you are right here, i haven't notice this. this can be fixed. thanks.
@@ -4,4 +4,11 @@ | |||
margin-left: 0; | |||
list-style: none; | |||
} | |||
|
|||
.wp-block-post-template { | |||
.is-root-container { |
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.
Is this change needed? padding-left
and padding-right
are already set in the rule above.
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.
yes, there is padding coming from somewhere, this is for WYSIWYG experience.
@@ -19,24 +19,18 @@ | |||
flex-direction: row; | |||
display: flex; | |||
flex-wrap: wrap; | |||
|
|||
gap: 1.25em; |
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.
If we're going to switch to using gap
, like @aaronrobertshaw mentions it might be worth allowing usage of the block gap CSS variable so that we can give users control over the gap between elements. Here's an example of a CSS rule we can use from the Navigation block.
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.
Yes, of course, this what I thought about too, but I thought I could do it in another PR.
👋 thanks for the PR @shadigaafar!
That goes for me as well.
Since we have settings for the columns, we can't do this as it will indeed be a breaking change and we will loose the ability to control this. In my mind for the recent future, |
@andrewserong @ntsekouras above this, currently, this does not quite work in RTL, the |
And please, don't talk about future too much, like we say in my homeland: "when it will born, we will name it". something is not here yet; we don't talk about it. we can't just keep things broken, hoping that the future will fix this. there should at least a temporary fix. as far as I have noticed, that the future will not fix anything, cos no one thinks there is a problem to be fix. if you can't see the problem, how you are going to fix it in the future. I'm very disappointed not because there is some issue with my PR, but that no one thought that this PR, adds any important value. |
There always should be a balance when we introduce a temporary fix, as this just increases complexity for the project and technical debt. First we should explore the best possible solution and also a temporary fix cannot introduce breaking changes.
I don't agree with this to be honest. It's not possible for everyone to see every possible problem, but when one sees a problem should create an issue for it. That's the way for others to become aware of this problem too and work towards its resolution.
Every contribution is valued and appreciated, including this one! This doesn't mean that other contributors can't express their thoughts, questions and concerns, no matter with the final outcome of the discussion. |
I just want to say that sometimes issues or PR's because of various reasons might take some time to get movement or agreed upon. It just happens. Sometimes we just need to pause a solution. I would then need to move on to other things and circle back at another time. Please do not let it stop you from contributing. |
Yet, you did not give an answer, What now? should I fix the problem with this PR? or should i just forget about it? What about the RTL related issue? should we leave it for now? |
Hi @shadigaafar , thanks for raising this issue and opening your first PR! 🎉 As other contributors have already mentioned, this PR introduces conflicts in other use cases and raises the overall complexity. This doesn't mean there is no issue to solve and the PR should not move forward, but that it will need further iterations and reviews before landing so that we can ensure we fix the issue while not introducing new ones. You are more than welcome to continue working on this PR. We will try to provide support and guidance as best as we can, although it's worth noting we are right in the middle of a release crunch so contributors' time is a bit scarce, as the current focus is addressing the WordPress 5.9 pending issues listed in #36556. In order for other folks to help understand the issue at hand, would you mind re-uploading a working version of the video in the opening message of this PR? This will greatly help get a better understanding for other people, easing the process to help with this PR. |
It as been close to a year with no response and no updates so I am closing this pull request. |
Description
gap
instead ofmargin-right
between elementsHow has this been tested?
Screenshots
post-tempate.mp4
Types of changes
#Bug fix (non-breaking change which fixes an issue)
Checklist:
*.native.js
files for terms that need renaming or removal).