Skip to content

Some CSS rules applied in the editor override theme styles #17511

Closed

Description

@markhowellsmead

Some of the rules which are provided to style the HTML elements which are only used for editor functionality override the usual CSS cascade. This forces Theme/Block authors to write more complicated CSS than is necessary.

An example is .wp-block-cover .block-editor-block-list__block {color: #f8f9f9;}. This is a specific colour assignment to an element which is only in the editor. However, this means that all children of .block-editor-block-list__block will inherit this colour. The much simpler CSS standard colour inheritance - which allows me to set the text colour on the outer .wp-block-cover and have it inherit down the tree - is broken.

Activity

  1. added
    [Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.
    on Sep 24, 2019
  2. ItsJonQ commented on Feb 12, 2020

    @ItsJonQ

    @markhowellsmead Thank you for raising this!

    This CSS specificity fighting between Blocks x Themes is one of the main problems that the Global Styles focus is attempting to solve.

    From our initial research/testing, we have ideas of how the style relationships between blocks, themes, and user configurations can live harmoniously (the dream)

    We've started with the very first phase of development. We're still quite ways off from implementing it into all blocks, as well as blocks x themes, but we'll get there!

  3. markhowellsmead commented on Feb 12, 2020

    @markhowellsmead
    Author

    Thanks for the feedback @ItsJonQ. Good to know that a solution is on the way. I guess you don't need me to cross-reference other issues along similar lines, such as #17069?

  4. markhowellsmead commented on Sep 28, 2022

    @markhowellsmead
    Author

    Closing this due to a lack of activity over the last three years.

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

    [Feature] Custom Editor StylesFunctionality for adding custom editor styles[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions