• Manish S

    (@shahmanish877)


    In the latest WordPress version, I noticed that the inner group (group inside group) has a different CSS for width & margin which is overriding my custom CSS of “container” class.

    How can I fix it? Is using !important on my CSS to override the only solution?

    The parent group is using “section” class so I can’t use “container” at the parent without modifying existing CSS.

    WP 6.5.2 Screenshot (with issue) – https://nimb.ws/1xpan3j
    WP 6.4.3 Screenshot (no issue) – https://nimb.ws/Btc1ukL
    WP 6.4.3 Screenshot for default CSS – https://nimb.ws/YdMmvHc

    Entire class “is-layout-constrained wp-block-group-is-layout-constrained” has been shifted from “wp-block-group” to “wp-block-group__inner-container”.

    This issue has affected to two of my website as I have checked. I need to check others too.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Firstly, I would recommend that you see if you can do without your customisation. You may already be able to achieve the desired view with the editor options that are now available.

    If not, the way to go would be to follow the CSS standard. Your property should use the same selector as the one you want to overlay – and preferably one more element/class for a higher weighting. The use of !important would be the last way, but also feasible.

    Thread Starter Manish S

    (@shahmanish877)

    @threadi But why sudden change in WP 6.5.2? It was working fine in 6.4.3.

    Does that mean that I should change every page through editor options for all of my sites?

    The output of the code developed by the Block Editor evolves over time. Optimisations are constantly taking place, also to enable more options in direct editing instead of relying on individual CSS code. In the past, such changes were even more frequent and more intense, but today they are rather rare. You have found one.

    How you deal with it now is up to you to decide. Either you use the possibilities of the block editor (if they fulfil your wishes) or you try to adapt your own CSS.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WordPress CSS override’ is closed to new replies.