Skip to content

Conversation

@haricot
Copy link
Contributor

@haricot haricot commented Dec 16, 2019

Sal (Scroll Animation Library) was created to provide a performant and lightweight solution for animating elements on scroll. It's based on the Intersection Observer, which gives amazing performance in terms of checking the element's presence in the viewport.
https://github.com/mciastek/sal
https://github.com/w3c/IntersectionObserver/tree/master/polyfill

In this, BootstrapUtilities give choice for property attr_type (css_classes or html_data_attrs)
Bootstrap4 is concerned with this with for example:

Scrollspy:
Automatically update Bootstrap navigation or list group components based on scroll position to indicate which link is currently active in the viewport.
https://getbootstrap.com/docs/4.4/components/scrollspy/

and for more generic:
GenericUtilities give same possibility as BootstrapUtilities but for generic library.

If it suits you, would you like it to be optional, like when the npm package sal.js is present?

The fonction__new__ is duplicated, we could remove it from BootstrapUtilities and use it like this, (this impacts the settings and should be branded deprecated for a while.) :

CMSPLUGIN_CASCADE = {
..
    'plugins_with_extra_mixins': {
        'BootstrapColumnPlugin': GenericUtilities(
        BootstrapUtilities.background_and_color,
        BootstrapUtilities.paddings,
        GenericUtilities.scroll_animate
        ),
     },
}

demo:
Peek 16-12-2019 14-55

@haricot haricot changed the title Sal (Scroll Animation Library) with CascadeUtilitiesMixin Feature: CascadeUtilitiesMixin and HTML data attributes used in sample with Sal (Scroll Animation Library) Jan 5, 2020
update utils mixin attr_type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant