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

Categories block doesn't inherit css from style.css on the Editor #43999

Closed
SGr33n opened this issue Sep 8, 2022 · 7 comments
Closed

Categories block doesn't inherit css from style.css on the Editor #43999

SGr33n opened this issue Sep 8, 2022 · 7 comments
Labels
[Block] Categories Affects the Categories Block

Comments

@SGr33n
Copy link

SGr33n commented Sep 8, 2022

Description

Hi!
Defining a custom style for the categories core block doesn't affect that style on the editor.
The style works, on the other hand, on the page list block (pretty similar to the categories one).

Step-by-step reproduction instructions

Add a categories list block and a page list block.
Add the following code on your styles.css

.wp-block-categories-list,
.wp-block-page-list {
	list-style-type: none;
	padding-left: 0;
}

both are working on the frontend, while only the page list block is getting the correct style.

This looks a problem on the Editor's class names:
block-editor-block-list__block wp-block wp-block-page-list on the block pages list.
wp-block-categories__list wp-block-categories__list-level-0 on the categories list block.

the second one should probably be:
block-editor-block-list__block wp-block wp-block-categories-list

Screenshots, screen recording, code snippet

No response

Environment info

WordPress: 6.0.2
Gutenmberg: latest trunk
Theme: TwentyTwenty-two

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

@carolinan
Copy link
Contributor

carolinan commented Sep 9, 2022

Hi!
Style.css in themes is not added to the editor by default. The theme needs to use an editor style. I mention this because it is not clear from the issue description, how the style.css is added. Sorry if this is obvious.

@carolinan carolinan added the [Block] Categories Affects the Categories Block label Sep 9, 2022
@SGr33n
Copy link
Author

SGr33n commented Sep 9, 2022

It's on twentytwenty-two, on the theme main stylesheet, it's correctly added to the Gutenberg editor:

Frontend:

Immagine 2022-09-09 125606

Gutenberg:

Immagine 2022-09-09 125701

@carolinan
Copy link
Contributor

Are you able to test if your CSS works with this PR? #43666

@SGr33n
Copy link
Author

SGr33n commented Sep 9, 2022

Sorry i forgot to mention that this test was made on the latest Gutenberg trunk, so this PR should already be in.

@t-hamano
Copy link
Contributor

@SGr33n
Thank you for submitting the Issue.
Issue #43666 was not merged at the time you commented, so it was not reflected in the latest trunk.
I have just merged it and would like to close this issue.

If you pull the latest trunk, you should see that this issue has been resolved.
If the issue has not been resolved, please do not worry about it and reopen.

@SGr33n
Copy link
Author

SGr33n commented Sep 10, 2022

Thanks @t-hamano and @carolinan!

@SGr33n
Copy link
Author

SGr33n commented Sep 10, 2022

I can confirm, #43666 solved this.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Categories Affects the Categories Block
Projects
None yet
Development

No branches or pull requests

3 participants