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

Additional CSS field is no longer full-height in Site Editor #68928

Closed
annezazu opened this issue Jan 29, 2025 · 8 comments · Fixed by #68993
Closed

Additional CSS field is no longer full-height in Site Editor #68928

annezazu opened this issue Jan 29, 2025 · 8 comments · Fixed by #68993
Assignees
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@annezazu
Copy link
Contributor

In WordPress 6.7, the following is shown for the additional CSS field:

Image

In WordPress 6.7 with GB 20.0, the following is shown which results in a much smaller field:

Image

Reporting as it's unclear to me if it's intentional or a regression :)

@annezazu annezazu added [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Enhancement A suggestion for improvement. CSS Styling Related to editor and front end styles, CSS-specific issues. labels Jan 29, 2025
@Rishit30G
Copy link
Contributor

Rishit30G commented Jan 29, 2025

Thanks for sharing this,

I can confirm that the issue is present,

WP 6.7 and with Gutenberg Plugin ( 20.1.0 ) enabled:

Image

WP 6.7 and Gutenberg Plugin ( 20.1.0 ) disabled:

Image

Edit: A quick fix to this is by removing the flex: 1 1 auto as it's making the textarea occupy the remaining space

Screen.Recording.2025-01-29.at.9.21.19.AM.mov

@t-hamano
Copy link
Contributor

t-hamano commented Jan 29, 2025

As I recall, this has to do with refactoring the Navigator component.

Adding some CSS like below should solve the issue, but there may be a more ideal approach. cc @WordPress/gutenberg-components

diff --git a/packages/edit-site/src/components/global-styles/style.scss b/packages/edit-site/src/components/global-styles/style.scss
index 99b1c8c92b..dae6a9df73 100644
--- a/packages/edit-site/src/components/global-styles/style.scss
+++ b/packages/edit-site/src/components/global-styles/style.scss
@@ -228,9 +228,14 @@
        }
 }
 
+.edit-site-global-styles-sidebar__navigator-provider {
+       height: 100%;
+}
+
 .edit-site-global-styles-sidebar__navigator-screen {
        display: flex;
        flex-direction: column;
+       height: 100%;
 }
 
 .edit-site-global-styles-sidebar__navigator-screen .single-column {

Either way, I'll be adding this to the 6.8 project board.

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended and removed [Type] Enhancement A suggestion for improvement. labels Jan 29, 2025
@ciampo
Copy link
Contributor

ciampo commented Jan 29, 2025

@t-hamano 's suggestion seems correct in principle, although I recommend testing the sidebar thoroughly , especially paying attention to the in and out animations of each screen (and potential scrollbar flickers).

Apart from that, I noticed two potential additional bugs:

It looks like the "additional CSS" navigator screen can't be triggered a second time, suggesting that there may be a bug in how the global styles sidebar is navigating away from the screen:

Kapture.2025-01-29.at.10.54.49.mp4

Also, the generated classname for the navigator components seem weird, as if the same classnames is being concatenated more than once

Image

I didn't open a separate issue in case folks can't repro

@Rishit30G
Copy link
Contributor

@t-hamano Thank you for your suggestions! After implementing the changes you shared, I noticed that the style of the input extends to full height when the Gutenberg plugin is enabled, would that be the intended behaviour ?

Image

@ciampo I did try reproducing the "Additional CSS" button issue ( with Gutenberg Plugin disabled ), but for me it seems to be working fine
Please let me know if I'm missing something 🙇🏻

Screen.Recording.2025-01-29.at.4.46.34.PM.mov

@t-hamano
Copy link
Contributor

It looks like the "additional CSS" navigator screen can't be triggered a second time, suggesting that there may be a bug in how the global styles sidebar is navigating away from the screen:

I was able to reproduce this issue when the Gutenberg plugin was enabled. See #68949

@t-hamano
Copy link
Contributor

After further investigation, I found that this issue was caused by #65522. However, #65522 is a necessary change for the Navigator component's exit animation, so it cannot be reverted.

The approach I suggested in this comment should not affect the animation, since it simply changes the height.

@Rishit30G Want to try this approach?

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Feb 1, 2025
@Rishit30G
Copy link
Contributor

Thanks for sharing the references @t-hamano

I'm curious to know would we want to reduce the size of the "Additional CSS" box or make it take up the remaining space
The implementation share in the comment will help the box take up the remaining space and keep the animations intact 👍🏻
I can see a PR with the implementation #68993

@t-hamano
Copy link
Contributor

t-hamano commented Feb 3, 2025

I'm curious to know would we want to reduce the size of the "Additional CSS" box or make it take up the remaining space

I think the current small size is an unintended regression caused by #65522, so let's move forward with #68993.

@t-hamano t-hamano moved this to 🏗️ In Progress in WordPress 6.8 Editor Tasks Feb 3, 2025
@github-project-automation github-project-automation bot moved this from 🏗️ In Progress to ✅ Done in WordPress 6.8 Editor Tasks Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
Development

Successfully merging a pull request may close this issue.

5 participants