- Issue created by @xamount
- 🇮🇳India mukeshMukesh12
this code dynamically adds and removes CSS classes on the body element based on the user's scrolling behavior. It can be used to trigger visual changes or apply different styles to elements based on the scroll position and scrolling direction.
this code will gives lot of help to Drupal themers without adding extra js code to achive different effects like fixed header, parallax effect etc.
as a frontend guy I think this is helpful.
Thanks
- Status changed to Closed: works as designed
over 1 year ago 9:36am 17 July 2023 - Status changed to Active
over 1 year ago 11:43am 17 July 2023 - 🇹🇹Trinidad and Tobago xamount
This code is only applicable if you use the mentioned effects (fixed header, parallax effect etc).
For sites using Bootstrap Barrio that do not use those effects, this code is 100% unused AND hinders browser performance.
(Read up on layout thrashing. This code hurts the Interaction to Next Paint (INP) core web vitals metric, especially on low-end mobiles).
It would have been better to have a enable/disable theme setting which would then load/not load this js if needed. For this reason, I am setting the status back to "Active". If you feel this issue is not important, then revert the status.
As of right now, it's loaded unconditionally.
Anyways, for the rest of us who choose not to use this code and would like to improve their INP metric slightly, you can ignore it like this.
In YOURTHEME.info.yml
libraries-override: bootstrap_barrio/global-styling: js: js/barrio.js: false
- Status changed to Closed: works as designed
over 1 year ago 10:48pm 17 July 2023