0

I have two plugins that use the same CSS id, in this case id="TB_ajaxContent" which I guess means that those two plugins use the ThickBox widget to display things in a popup blackbox.

One of those plugins added the !important tag on some CSS properties on their ThickBox which breaks the layout of the other plugin's ThickBox.

I imagine that this could happen quite often since many plugins surely must use the same common JavaScript widgets.

Is there a way around this so that I won't be limited in my use of plugins because they happen to use the same widgets and one of them tweaks them to fit their plugin which could break the other?

6
  • I'd guess you'd have to customise the CSS for one or both plugins e.g. change the prefix or make the CSS specific to each plugin, or add a containing element to all of the CSS so that it only applies to the specific widget or similar that each one sets up. I don't think there's a simple mechanism to isolate this CSS.
    – Rup
    Commented Apr 11, 2022 at 9:10
  • You could always raise this as an issue with the plugin that adds the !important, that they're breaking other things, and see if they're willing to fix it too
    – Rup
    Commented Apr 11, 2022 at 9:11
  • 1
    not without forking them into a new plugin, you need to contact their support, 3rd party plugin dev support is offtopic here
    – Tom J Nowell
    Commented Apr 11, 2022 at 9:15
  • @Rup Is it standard practice to always use ones own prefix even when using others widgets in ones own plugin? And in my case the developers didn't think about doing it and I should perhaps point it out to them? In regards to customise the CSS, wouldn't those customisations revert back whenever the plugin is updated? Or is there are way around it, like instead of a child theme a child plugin?
    – Alex
    Commented Apr 11, 2022 at 10:38
  • I don't know. I think it's sensible to do if you're actually modifying the CSS and there's a risk of a clash with someone else using the same control (as happened here). If you do talk to them I'd probably pitch it as "this is incompatible" rather than "you've done something wrong" - you want their help after all. Unless I suppose you're paying them.
    – Rup
    Commented Apr 11, 2022 at 10:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.