
just do that:
beans_add_attribute( 'beans_header', 'data-uk-sticky', '{top: -100, animation: "uk-animation-slide-top"}' );
although that animations nor working very good on my sticky header.

Hey Jochen,
I tried that. It still doesn't work.
Although, on my static site, the animation appears much better when it's used together with showup:true
, compared to when it's used with top:-100
. When I give it the 'top' value, the animation is a little 'wonky', on the scroll-up to the very top.
Personally, I like the showup:true
option. It clears the space and gives more room to the 'above the fold' screen area.
I find it makes a difference, especiallly on tablets, where the space gets cramped easily.
I tried all sorts of combinations here, but I couldn't get it to work. The animation is not showing at all.
I have registered it, and it shows up in my list of UIkit components :
Array
(
[components] => Array
(
[core] => Array
(
[0] => base
[1] => block
[2] => grid
[3] => article
[4] => comment
[5] => panel
[6] => nav
[7] => navbar
[8] => subnav
[9] => table
[10] => breadcrumb
[11] => pagination
[12] => list
[13] => form
[14] => button
[15] => badge
[16] => alert
[17] => dropdown
[18] => offcanvas
[19] => text
[20] => utility
[21] => icon
[22] => animation
[23] => flex
[24] => animation
[25] => contrast
[26] => overlay
[27] => thumbnail
[28] => modal
[29] => scrollspy
[30] => smoothscroll
[31] => animation
[32] => flex
[33] => close
[34] => modal
[35] => overlay
)
[add-ons] => Array
(
[0] => slidenav
[1] => dotnav
[2] => lightbox
[3] => slider
[4] => slideshow
[5] => accordion
[6] => slideshow-fx
[7] => sticky
[8] => tooltip
)
)
[themes] => Array
(
[default] => G:/xampp/htdocs/wp/wp-442-1044/wp-content/themes/tm-beans/lib/api/uikit/src/themes/default
[beans] => G:/xampp/htdocs/wp/wp-442-1044/wp-content/themes/tm-beans/lib/assets/less/uikit-overwrite/
)
)
Not sure what's going on . π

I got the animation to work ! π
All I had to do was change the single and double quotes. I noticed that the static html site expects the single quotes inside the curly brackets, so I changed things around, to look like this :
beans_add_attribute( "example_primary_menu", "data-uk-sticky", "{ animation: 'uk-animation-slide-top', showup:true }" );
Now the animation is showing quite nicely, when the navbar apears, on scroll-up.
Thanks again, Jochen, you pointed me in the right direction. Again π

cool, you made it π
But in that situations its easier to escape the single quote with an backslash before. Like that:
beans_add_attribute( 'example_primary_menu', 'data-uk-sticky', '{ animation: \'uk-animation-slide-top\', showup:true }' );

I knew that !
Just couldn't think of it π

I just figured out the smooth-scroll
for my one-page menu.
The problem was what I would call a 'naming confusion', which - IMHO - is a bit of an oversight on the part of the UIkit developers.
The component 'smooth scroll' is controlled by smooth-scroll.js
, or smooth-scroll.min.js
. Notice the hyphen -
in the file name.
Now, to CALL the component's functionality on some page element, like an ul
of a menu, and to combine it with the scrollspy
UIkit component, this code works :
<ul class="uk-navbar-nav" data-uk-scrollspy-nav="{closest: 'li', smoothscroll: {offset: 30}}">
Notice that the property smoothscroll
is WITHOUT a hyphen.
This is what threw me. I assumed that the name which is used to register UIkit components and add-ons with Beans , with beans_uikit_enqueue_components
would also be smoothscroll
, without a hyphen.
Once I added the hyphen there , like this : smooth-scroll
, the code started to work .
What made things even more complicated, is that the printed list of active UIkit components also listed smoothscroll
without hyphen, even though that's a wrong name.
A little thing, but hard to spot.
I just thought I should give others a bit of a 'heads-up'.
Cheers,
Yuna M.

Good thing to point out.

Hey Yuna
It would be great if you post the finished result of the code and CSS. Thank you.