UIkit 2.13 – Use multiple UIkit versions without conflicts

UIkit 2.13 – Use multiple UIkit versions without conflicts

  • Olivia
  • UIkit

Today we are pleased to announce a new version of UIkit. This time we focused on making UIkit more future proof and robust when multiple versions of it are used on the same page. Imagine more and more themes and extensions are built with UIkit and loaded on the same page. Even worse, if they load different versions of UIkit, it will cause trouble as different releases might use the same components and classes but in different ways. UIkit 2.13 now allows you to load multiple instances of UIkit side by side without any conflicts.

By just creating a custom prefix, meaning anything you like, instead of the common uk- for your UIkit instance, you can avoid conflicts between these versions. The documentaion on UIkit gives you further instructions on how to create a custom prefix.

Breaking JavaScript Changes

We changed our event names to be more conform with the existing frameworks out there. The new structure follows this convention {action}.uk.{component}.

$(document).on('closed.uk.alert', function() {
    alert('An alert was closed!')
});

Another advantage is that if you have included other frameworks like Bootstrap or Foundation, you just need to listen to closed to make your code cross-framework compatible.

Also, worth mentioning is that we moved UIkit to the global namespace, so you can access UIkit directly with UIkit instead of $.UIkit. The reference within jQuery is deprecated now.

We're excited to hear your thoughts and feedback on the latest releases.

Related



Join Now
Documentation