ASU / asu-unity-stack

ASU Unity Design System
https://unity.web.asu.edu/
Other
11 stars 8 forks source link

Determine what utility scripts should be included #14

Closed ctestama closed 1 year ago

ctestama commented 4 years ago

nathan-rollins commented on Jul 8

We need to review and select what utility scripts should be included in this base framework. What are the fundamental quality-of-life, security-improvement features that should be active in all implementations?As an example, GIOS' Bootstrap 3 framework bundled around a dozen scripts (src), including:FastclickMoment date helperSmooth ScrollIframe breakoutA custom print view script that automatically footnoted all links with source list at end of printoutand others

--

ctestama commented 4 years ago

SteveRyan-ASU commented on Jul 9

Looking at the scripts one by one, here's what I think.

CalendarPopover - Would be nice to have. An extension of the native BS popover element.

Footer_Collapser - This functionality isn't explicitly in the brand guide, but it provides a standardized way to collapse the global footer elements in mobile.

🚫FastClick - Pretty sure this isn't needed any longer. Solves a problem from Chrome < 34 (circa 2014) for mobile devices. Also reduces an additional dependency as FastClick was an external library, right? https://github.com/ftlabs/fastclick

iFrameBreakout - Still a thing, still needed.

MobileMenu - If this is the correct way to load elements into the global ASU menu, then yes, we should keep this one. But there's a LOT of open questions here. Separate issue?

🚫NavsClickHover - Pretty sure this is also solved by BS4 and the decision NOT to allow for top-level menu items to also function as links. As long as we are NOT planning to override this behavior (which is the correct move for accessibility/mobile purposes), we shouldn't need this.

Print_Footnote_Links - I'd say let's go ahead and include this in our distribution. But if the outcome was to move this functionality into a WP / Drupal plugin for easier enable & disable functionality, I'd also be fine with that too.

🚫Sidebar - Bootstrap 4 drops the affix JS plugin as a requirement in favor of position: sticky in CSS. The fixes within this script will no longer be correct as a result. Support for the CSS rule is limited, so perhaps a polyfill is in order?

SmartResize - I'm doubtful that this is still needed, but I'm not 100% sure.

smoothScroll - As long as we are still using jQuery elsewhere, we may as well utilize this jQuery plugin, too. I have no idea about the code-bloat effect, but the library looks current-ish. https://github.com/kswedberg/jquery-smooth-scroll

  • The moment we start using raw JS (Bootstrap v5 anyone?), this would go away in favor of vanilla JS, which is much cleaner.

StickyNav - May not be needed any longer. Replaced by utility CSS classes for position-top and position-bottom? https://getbootstrap.com/docs/4.0/components/navbar/#placement

  • Not sure how these utility classes would affix the menu in relation to the global header

🚫Wait-forJS - Newer JS practices render this sorta thing not needed, right?

ctestama commented 4 years ago

nathan-rollins commented on Jul 11

Yeah, some of those should be ditched or rethought.

But I am also wondering whether it would be helpful to provide a useful selection of other utilities, such as for animations (transitions, parallax, etc).

For instance, my team has recently made use of simpleParallax as a JS helper and polyfill for CSS3 animation effects. Obviously, we don't want to over-bundle features that just bloat our packages, if those features are rarely used.

We don't have to solve all these questions right away. This can be an open discussion for the future. Perhaps we will take a look at our final product and decide to modularize it, so developers can pick and choose what parts of this UI kit they actually need or want.