Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

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