UIkit 3.12 β Sticky Parallax and Lazy Loading Images
The first UIkit release in 2022 is huge. We have refined the Sticky and Parallax components so that now you can create stunning sticky parallax effects out of the box. Additionally, we completely refactored the Image component and improved it with new features. And we finally dropped the IE 11 support. Let's jump right in.
Make sure to subscribe to our YouTube channel and join our Discord Chat Server for all news and discussions.
Parallax Component
To give you more control over the duration of the parallax animation, we added new start
and end
options to the Parallax component. By default, the animation starts when the top border of the element enters the viewport, and ends when its bottom border leaves the viewport.
The new options allow you to offset these start and end points. Values can be set in any dimension units, namely vh
, %
and px
. The %
unit relates to the element's height. Both options allow basic mathematics operands, +
and -
. In this example, start: 100% + 50; end: 100% + 50
, the animation will start 50px after 100% of the element's height enters the viewport, and it ends 50px before the element reaches the viewport's bottom border.
For even more control, animation stops can have a second value in percent for the position. This is very similar to the CSS linear gradient syntax. In this example, x: 0, -30vw 40%, 30vw 60%, 0
, the animation starts on its initial position, moves to the left till it's at 40% of its duration, then quickly moves to the right till it is at 60%, and finally moves back to its initial position.
Additionally, we also cleaned up the component and fixed some edge cases.
Sticky Component
Next, the Sticky component can now handle oversized content much better. Till now, content larger than the viewport could not be sticky. Now oversized content will scroll down and stick to the bottom of the viewport. But if you change the scroll direction, the sticky content will immediately scroll up and stick to the top of the viewport.
Have you noticed? Elements can now also stick to the bottom of the viewport, for example a cookie banner. We added a new position
option with top
, bottom
and auto
values to define the sticky behavior. If you set the value to auto
, the element will stick to the top of the viewport, but if its content is larger than the viewport, it will stick to the bottom of the viewport.
Additionally, just like with the Parallax component, we also added support for basic math operands for the sticky offset
option. And again, there are even more fixes and smaller improvements for the Sticky component.
Sticky Parallax
Now to the most interesting part. If you combine the Sticky and Parallax components, you can achieve some stunning sticky parallax effects directly in UIkit.
To grasp how the following effects work, let me first explain the basic concept behind sticky parallax effects. First of all we have a container which is multiple viewports high. This will define the duration of the parallax animation. Within this container we have a sticky container which has the height of one viewport. It, in turn, contains the actual content with the parallax animations. As a result, the content will not scroll out of the viewport, but instead it will have the parallax animation while you are scrolling.
Now let's see it in action. We have created a dedicated showcase in the UIkit tests for the Sticky Parallax.
Simply WOW, right? All these effects are built without custom JavaScript, just pure UIkit.
Utilities
In order to achieve the sticky parallax effects without any custom CSS, we have added some new utility classes to UIkit. There is a class to set a negative z-index, classes for object fit and position as well as new height viewport classes.
Image
But that's not all, UIkit 3.12 also comes with a big update for the Image component. Since all modern browsers support lazy loading images, and Safari 15.4 is on its way to join them, we deprecated the uk-img
attribute for <img>
element. Instead, you should use the native loading="lazy"
attribute. This also means that we no longer add an empty placeholder image so that now image elements need width
and height
attributes to prevent layout shifts. So what is the Image component for? It brings all the features from image elements like lazy loading and responsive images to background images. In this release, we added even more features.
In addition to lazy loading, background images can also have the loading="eager"
attribute to avoid lazy loading in the first visible viewport.
<div data-src="" uk-img="loading: eager">...</div>
We already support responsive images with the srcset
attribute for background images, and now we've added the sources
option with srcset
, media
and type
parameters to fully emulate all the features of the <picture>
element.
<div sources="srcset: ____; media: ____" data-src="" uk-img>...</div>
<div sources="srcset: ____; type: ____" data-src="" uk-img>...</div>
For example, this feature allows you to offer alternative image formats like WebP and AVIF for background images.
So the Image component got heavily refactored and also it no longer relies on session storage to check for cached images.
By the way, other components now also support the loading="lazy"
attribute. The SVG component will inject inline SVGs as they enter the viewport. And Slideshow and Slider components will automatically remove the loading="lazy"
attribute from adjacent slides, so they will be immediately displayed.
IE11 Support
Since Microsoft will retire Internet Explorer 11 in June 2022, we have decided to drop IE 11 support for UIkit as well. This allows us to leverage the latest web technologies meaning all the ECMAScript 2015 features like Promises, Classes, Arrow Functions and more. And of course this results in smaller CSS and JavaScript file size.
Migration to UIkit 3.12
There are some small breaking changes for the Image and Parallax components, so please take a look at the migration guide. For further release discussions or to report issues, visit our Discord chat.
What's Next
UIkit 3.12 allows you to create stunning sticky parallax effects with ease, and it completely modernizes the Image component.
As you all know we are eagerly waiting to start working on UIkit 4, which is only one YOOtheme Pro release away. Fingers crossed π€
And now, go ahead and try out those animations yourself. As always, we are looking for your feedback, so let us know what you think about this release in the comments below.
roger.walker.arnott
resonance
On a completely different topic, we have three tickets open in the support channel right now. One of them has gone unanswered for three days with no response, one for seven days with no response, and one that has been open thirteen days, which has had a single 'we are looking into this' response, but not an answer.
If there is a temporary delay in support because the entire team is heavily focused on getting the Menu Builder released by the end of the first quarter (17 days away), that can be forgiven. Certainly, no one paying for Yootheme support and updates is wanting further delays to that feature, but some communication to that end would be welcome.
Nice update otherwise.
hanna
resonance
Is there an support@ email address we're supposed to be using or could be using instead?
Of the three tickets you said would be forwarded, only one has been answered, and we added a new ticket six days ago, which hasn't received any response.
akcreation
Nice work guys!
Can't wait for the mega menu next - this is an exciting month for us
dezcool
When shall we expect to see this incorporated into YOOtheme PRO?
channelsurfer
triangle
florianwachter
What i miss from time to time, as i am not that coder dude - is some kind of tutorials or hands on videos. Maybe we can arrange sth. like that with the community - would be pretty cool (as an example i take the "Attributes" in the Advanced tabs - i am sure it is a very powerful tool - but i have no idea how to use it correctly)
AND - as you mentioned - itΒ΄s the first release this year - which is not totally right as you had a template on jan. 12th. . . I know you are all bound in an and i am sure you are busy. - But please be aware: you are charging 360 Bucks from us every year - please give us some more Templates / Updates - Communication, that we even have the feeling of the subscription is worth its money. You did that so wonderful in former times - i was sitting every 1st. of every month on the PC - totally excited what will come this month. When starting it was a template - then you went over to - template or new feature. In the meantime,... you know what i want to say. . . Please be aware - your capital is the community. We still love you - but you need to communicate with us.
Take care guys.
hanna
Concerning the updates and communication, in case you havent done it yet, follow us on Twitter. You will get all the newest updates first hand.
arthur.rosa
Please, listen tΓ΄ that, this is paramount for the success of Yootheme.
michael.ehline
Hello. I love Yootheme Pro.
But since Core Vitals became a major ranking factor, I have lost over $600,000 in organic traffic to my Yootheme pro website.
Even if I remove every single element and image from my site, It will not pass core vitals even with a score of 90.
Here is a link to a blog post where I blocked virtually every element and even the image (an important ranking factor) from mobile.
https://pagespeed.web.dev/report?url=https%3A%2F%2Fehlinelaw.com%2Fblog%2Ffamous-people-who-failed-bar-exam
Can you please help me move my site to a faster theme? I will pay you. This is an emergency, as Yootheme Pro is killing my rankings.
gunnar
I'm not affiliated with yootheme but I got concerned since I've set up half a dozen clients with yootheme and had to check what was going on!
I took a look at your link and it seems like google is showing the accumulated score for all pages on your domain for now until it has gather enough data on the current url. "There is insufficient real-user data for this URL. Falling back to aggregate data for all user experiences on this origin ( https://ehlinelaw.com) instead".
I then ran a quick check of your Core Web Vitals using webpagetest.org and noticed that your issue might not completely be of yootheme's fault. https://webpagetest.org/result/220403_AiDcT5_8KM/?view=webvitals
In this test I could see that it took a while for the browser to paint the top of the page. Since you didn't have a pic there it was a little odd. It should be painted rather quickly. So I ran a speed test and found that you have a problem with your fonts. Most if not all of them can not be found! The lines in red here mean that they're not found. https://webpagetest.org/result/220403_AiDcQE_8Y2/1/details/#waterfall_view_step1
There also seems to be a caching issue. Seems like the page is not getting cached properly and the browser is getting fed content from the database instead of a cached copy from the server's ram memory.
My quick tip would be to see why the fonts aren't loading and then look in to why the caching plugin is behaving as it should. Nginx servers have different caching have rules so check if the plugin has some specific setting for nginx servers. Once you got these things fixed you should have a lot better scores all across the board!
If you can't get it sorted out then let me know at john@uudly.com and we'll take it from there.
Cheers!
/John
Enomax.com
I'm also happy to help info@selfmed.pro .
yannis
hanna
smint
I am asking for a friend.
tuunbaq
Can you be more specific?
Will the MegaMenus be ready in a few days, a week, a month, several months or even a year?
akcreation
It looks like they are working on squashing bugs for the 'drop' and 'sticky' components - both of which I imagine will play a big part in the Mega Menus. So I'm guessing the release is delayed because of unforeseen issues.
But you are right, it would be nice to get some sort of update on the release timing (they tweeted 1 month ago that it was 'almost ready', I don't know why they would do that and then say nothing for 1 month!)
hubert.cole
much-needed overhaul of the Image component. uk-img="loading: eager" helps a great deal with core vitals and having a native lazy loading function will make it so much simpler to design picture grids.