Support » Plugin: Conditional Blocks - Control visibility of any Gutenberg block » maybe adds !important css rules ?

  • Resolved MB Creation

    (@mbcreation)


    Hi,

    The plugin looks great. However it looks like CSS rules might be overruled by plugins like “autoptimize” or any css minifier. (becouse loading order or mixing files.)

    Maybe you should consider “!important” rules. Or even better, server side rendering ?

    Thanks for your time.
    Benoit.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Morgan Hvidt

    (@morganhvidt)

    Hi Benoit,

    Thank you for letting me know. I’ll definitely look at adding that for those edge cases. Can you confirm that adding !important rules solved it on your end and it’s not another issue?

    Just an FYI: depending on the conditions Conditional Blocks will fully remove blocks from the server-side. However, when it comes to the screen size conditions blocks those are hidden using CSS, so the user can resize the browser as they need and still see the correct blocks.

    Let me know if you have any additional details. e.g if happens with a specific theme + autoptimize.

    Thanks! 😊

    Thread Starter MB Creation

    (@mbcreation)

    Hi Morgan,

    Thanks for the quick reply.
    You could check it live here : https://www.marshalltravel.fr/
    Added !important did the trick. I’m using storefront (with a child) & autoptimize.
    I was a bit in a rush so i didn’t dig more than that for now.
    Good news if you do some work server side also 👍

    I’m encountering a similar thing alongside GenerateBlocks. I’ve some elements not hiding due to CSS specificity overriding the rule.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.