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

Enable 'Inner blocks use content width' for the main Groups #54

Closed
mghenciu opened this issue Jul 7, 2023 · 14 comments · Fixed by #75
Closed

Enable 'Inner blocks use content width' for the main Groups #54

mghenciu opened this issue Jul 7, 2023 · 14 comments · Fixed by #75
Assignees
Labels
bug This label could be used to identify issues that are caused by a defect in the product. released Indicate that an issue has been resolved and released in a particular version of the product. small (1-3h) This label is used for issues that can be completed within 3 hours or less.
Milestone

Comments

@mghenciu
Copy link
Contributor

mghenciu commented Jul 7, 2023

Description

As discussed on Slack, the sections on each page are imported as a Main Group, but this makes it look like the whole page has a Padding.

In order to mitigate this, we need to enable the Inner blocks use content width for the main groups, which will make the Padding invisible in the Editor.

Step-by-step reproduction instructions

  1. Create a fresh instance
  2. Install Neve FSE 1.0.3
  3. Open the Front Page in edit mode and notice the visible Padding in the Editor

Screenshots, screen recording, code snippet or Help Scout ticket

Screenshot 2023-07-07 at 11 37 07
Screenshot 2023-07-07 at 11 34 09

Screenshot 2023-07-07 at 11 31 57


The setting that needs to be enabled:
image

Environment info

No response

Is the issue you are reporting a regression

No

@mghenciu mghenciu added the bug This label could be used to identify issues that are caused by a defect in the product. label Jul 7, 2023
@JohnPixle
Copy link
Contributor

JohnPixle commented Jul 10, 2023

For the record, adding some more context... We discussed about this in Slack, and turns out that this solution with the Inner blocks use content width will not work for all templates.

However, adding a bg color to the main containers does. Essentially we need to apply a bg color to the main groups (a custom bg color with zero opacity appears to be a solution. This fixes the padding issue.

Thanks!

PS: @mghenciu I also added this in the design board, to have this under our radar. If you decide to tackle this yourself with a new PR, feel free to do so. Let me know if I can help in any way ✌🏻

@mghenciu
Copy link
Contributor Author

@JohnPixle , I did the required changes in this PR.
Tested a few times and the padding issue looks to be fixed.

When you have some time, to review it @preda-bogdan 🚀

@mghenciu
Copy link
Contributor Author

As an update here, the issue looks to be more dev oriented and complex than just enabling the Inner blocks toggle; that's why we put it On Hold in the Design Board.

As next steps, we need to review a bit the things in terms of default theme padding and spacing, plus make sure we are compliant with the main group required by wordpress; and of course that things work as expected in any FSE context.

We'll need some dev help here, @HardeepAsrani .
I've added more details about the challenges, in this PR.


Also we wanted to ask how would this changes affect the existing sites? for example let's say we update the color for a section, or we change some icons, etc. -> when released, would this changes also apply on the existing sites that use Neve FSE?

@mghenciu
Copy link
Contributor Author

@HardeepAsrani , pleased don't forget about this one - when you get some time.
Should I add it in the Backlog or To Do?

@HardeepAsrani
Copy link
Member

@preda-bogdan Can you look at if you have the time?

when released, would this changes also apply on the existing sites that use Neve FSE?

Looking at the changes, I think they won't affect existing sites as we only change template content. Correct me if I'm wrong, Bogdan?

@mghenciu mghenciu removed their assignment Aug 8, 2023
@JohnPixle JohnPixle added this to the 1.1.0 milestone Aug 8, 2023
@HardeepAsrani
Copy link
Member

@cristian-ungureanu Can you look into this when you have some time? Mihai has already made a PR related to this.

@mghenciu
Copy link
Contributor Author

mghenciu commented Aug 18, 2023

Just fyi: it looks like the issue I was mentioning here, regarding previewing Styles - this doesn't happen on 6.3.

@cristian-ungureanu cristian-ungureanu added the small (1-3h) This label is used for issues that can be completed within 3 hours or less. label Aug 21, 2023
@cristian-ungureanu
Copy link
Contributor

cristian-ungureanu commented Aug 21, 2023

@mghenciu @HardeepAsrani the reason for that padding inside the editor is actually this code:

https://github.com/Codeinwp/neve-fse/blob/main/assets/css/src/common/_generic.scss#L45-L55

Bogdan started from Fork's style, we have the same issue there. After digging a while, here's what I've found:

The style was added because in ( not that ) older WP versions ( eg. WP 6.1 ) we had this issue: https://vertis.d.pr/v/VLFBl1. After digging some more, I found out that removing this line here https://github.com/Codeinwp/neve-fse/blob/main/theme.json#L14 fixes both the current issue that we have now, and the fix even works on WP 6.1, allowing us to also remove that padding style. There's no need to change the templates.

As I'm not quite an expert with FSE themes, please let me know if you can think of a downside to the solution I've mentioned.

PS: You can use the build from the PR if you want to test this.

@mghenciu
Copy link
Contributor Author

Thank you for the in-depth research, Cristi.
Also, not an expert in FSE themes :)) but I would we can take inspiration from Core FSE themes: 2023 and 2022, and Frost (which are available on Github).

If this fix is working without doing any templates changes -> that's even better 🚀

@cristian-ungureanu
Copy link
Contributor

Thanks, Mihai for the feedback! I actually did check WP FSE themes and none of them are using the outer property, nor the padding that we're adding.

@JohnPixle
Copy link
Contributor

Thanks for the insights @cristian-ungureanu.
Sounds good. Would be great if we just adjust the code without messing with the templates. From me it's fine to proceed.

I just tested the build you suggested, and it works fine.

Thank you for looking into it. Just to be clear, this change will need to happen with other themes as well? (fork?)

@cristian-ungureanu
Copy link
Contributor

Thanks for the feedback, John! Yes, we would need to make the same changes on all of our FSE themes. I personally checked Fork but I think they all share this part.

@JohnPixle
Copy link
Contributor

okay, sounds good. Thanks Cristian!

cristian-ungureanu pushed a commit that referenced this issue Oct 25, 2023
fix: unwanted padding inside the page editor [#54]
@pirate-bot
Copy link
Contributor

🎉 This issue has been resolved in version 1.0.6 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This label could be used to identify issues that are caused by a defect in the product. released Indicate that an issue has been resolved and released in a particular version of the product. small (1-3h) This label is used for issues that can be completed within 3 hours or less.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants