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

"Customize CSS" should not be in Command Palette for non-block themes #64932

Open
2 tasks done
MadtownLems opened this issue Aug 30, 2024 · 8 comments · May be fixed by #65155
Open
2 tasks done

"Customize CSS" should not be in Command Palette for non-block themes #64932

MadtownLems opened this issue Aug 30, 2024 · 8 comments · May be fixed by #65155
Assignees
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@MadtownLems
Copy link

Description

"Customize CSS" is available as a command palette function in the context of editing Template Parts, but it shouldn't be there (as that shouldn't be relevant to non-block themes). The good news is that it just seems to fail silently, but it shouldn't be present in the UI.

Step-by-step reproduction instructions

  1. Have a non-block theme that uses Template Parts.
  2. Access the Command Palette, and type 'CSS'. See that "Customize CSS" is listed

Screenshots, screen recording, code snippet

css

Environment info

Tested on 6.6.1, both without Gutenberg and with Gutenberg 19.1.0

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes
@MadtownLems MadtownLems added the [Type] Bug An existing feature does not function as intended label Aug 30, 2024
@Mamaduka Mamaduka added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Aug 31, 2024
@rutviksavsani
Copy link

@MadtownLems Can you please specify the Theme where you found the issue. I tested it on Twenty Twenty One theme and was not able to reproduce it.

Thanks!

@MadtownLems
Copy link
Author

MadtownLems commented Sep 2, 2024 via email

@MadtownLems
Copy link
Author

You may want to see #56007 for a similar problem and resolution.

@t-hamano fixed that one, and perhaps can do similar here?

@t-hamano
Copy link
Contributor

t-hamano commented Sep 2, 2024

I can't reproduce the problem 🤔

@MadtownLems

  • Just to be sure, did you launch the command palette after accessing Apperance > Patterns > All template parts > any template part?
  • Is the theme you're having problems with exposed to the theme directory?
@MadtownLems
Copy link
Author

MadtownLems commented Sep 2, 2024 via email

@MadtownLems
Copy link
Author

Complete steps to reproduce:

  1. Take Twenty Twenty One, and add template parts support, such as:

function add_block_template_part_support() { add_theme_support( 'block-template-parts' ); } add_action( 'after_setup_theme', 'add_block_template_part_support' );`

AND adding something to theme.json to register one:

`{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3,
"settings": {
},
"templateParts": [
{
"name": "my-template-part",
"title": "My Template Part",
"area": "some-area"
}
]

}`

Once you do, you don't even need to do anything with Template Parts. Simply Add New Pattern, access the command palette, and find "Customize CSS" is now present
2024-09-03 07_40_54-Jason New Pattern ‹ Pattern ‹ Twenty Twenty One ‹ Editor — WordPress

@t-hamano
Copy link
Contributor

t-hamano commented Sep 4, 2024

Thanks for the reply. I was able to reproduce this issue.

All that's needed to reproduce the issue seems to be to add a theme.json to the classic theme. Simply create a theme.json with an empty object ({}) in the Twenty Twenty-One theme and you'll be able to reproduce this issue.

@MadtownLems
Copy link
Author

Thank you for confirming and for making the steps to reproduce even easier! I ran through what I believe are all the commands, and that was the only one that seemed out of place for our type of theme.

Until core stops adding it, I'm trying to figure out how to unregister it myself: #65021

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
4 participants