Many admin functions in Civi send the user to Ajax popup boxes. Eg on the Contact screen, Membership > Add membership, Events > Add Event... and many many more through the system.

What is the best way to load custom css into these?

We are using a custom css file for the rest of Civicrm - but it's not being loaded in these ajax popups. From a load-time point of view, that's possibly a good thing! Some of our admin users are in poor internet areas, and those popups can be very very temperamental when the net is slow. So it would be great if we could just add some minor css tweaks to these popups rather than load the whole of our custom css into them.

Thanks for your ideas. Drupal 7.54, Civicrm 4.6.25.

  • If Administer > Customize Data and Screens > Display Preferences Jun 24, 2017 at 17:12

2 Answers 2


The custom css file do load on every page of civicrm, even the pop ups. Note that the elements in the ajax contains different ids and classes(mostly starts from ui-**) compare to page view.

So you need to redefine the css for them on your custom file.


Coming at this from a different angle that still allows customization and seemed to be more performant than ajax calls for us, you could disable the pop up forms altogether and have the admin screens as separate page loads. We did this on our install and found it much more advantageous. Administer > Customize Data and Screens > Display Preferences. Uncheck the box labeled:

Enable Popup Forms If you disable this option, the CiviCRM interface will be limited to traditional browsing. Opening a form will refresh the page rather than opening a popup dialog.

  • 1
    Thanks for the thought! We did look at this, but sadly for this purpose, our consensus was that in general the popups work so well that we'd prefer to keep them if we possibly can.
    – Andyg8
    Jun 25, 2017 at 20:11
  • Cool, just wanted to make sure you knew it was there. Hope it works out! Jun 25, 2017 at 20:47

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.