jrief / djangocms-cascade

Build Single Page Applications using the Django-CMS plugin system
MIT License
165 stars 85 forks source link

Feature: CascadeUtilitiesMixin and HTML data attributes used in sample with Sal (Scroll Animation Library) #367

Open haricot opened 4 years ago

haricot commented 4 years ago

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