Add classList on View base #20
NathanaelA
started this conversation in
1. Ideas & Discussions
Replies: 1 comment 2 replies
-
What s the overhead of that on ViewBase? I tend to never use css anymore because it is much faster. Thus my question, what s the overhead in code and perfs of adding classList? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
One of the items I created way back in NS1 days was adding "classList" to the base view classes so that you can do:
View.classList.toggle("hidden")
orView.classList.add("blue");
-- The current NS theme's also re-implements this same code and I've seen a couple other plugins re-implement this. https://developer.mozilla.org/en-US/docs/Web/API/Element/classList -- I would be willing to merge my code from my plugin into core so that this is supported on all elements that have a "class" property.The actual functions that
classList
support are documented here as classList is a DomTokenList object:This is one of the few utility functions that I find so helpful as you can easily add/remove/toggle classes on any element which can be very helpful in highlighting errors, flow, or even starting/stopping animations...
Beta Was this translation helpful? Give feedback.
All reactions