Skip to content

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

Closed

Description

@SGr33n

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

Activity

  1. carolinan commented on Sep 9, 2022

    @carolinan
    Contributor

    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.

  2. added
    [Block] Categories
    on Sep 9, 2022
  3. SGr33n commented on Sep 9, 2022

    @SGr33n
    Author

    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

  4. carolinan commented on Sep 9, 2022

    @carolinan
    Contributor

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

  5. SGr33n commented on Sep 9, 2022

    @SGr33n
    Author

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

  6. t-hamano commented on Sep 10, 2022

    @t-hamano
    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.

  7. SGr33n commented on Sep 10, 2022

    @SGr33n
    Author

    Thanks @t-hamano and @carolinan!

  8. SGr33n commented on Sep 10, 2022

    @SGr33n
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] Categories

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions