After writing a bunch of code like this:
this.actionButton.classList.add(..."px-4 bg-transparent p-3 rounded-lg text-indigo-500 hover:bg-gray-100 hover:text-indigo-400 mr-2".split(" "));
When building up javascript elements with lots of classes from html, I finally wised up and made a change:
DOMTokenList.prototype.set = function(classString) {
this.add(...classString.split(" "));
}
// now I can do this:
this.actionButton.classList.set("px-4 bg-transparent p-3 rounded-lg text-indigo-500 hover:bg-gray-100 hover:text-indigo-400 mr-2")