https://htmx.org/essays/locality-of-behaviour/
I don't use HTMX as I would like a smaller JS bundle. I would also like an efficient CSS system of utility classes. I think Hypermedia libraries & CSS utility libraries can be improved. I'm also working on app systems to reuse code across domains...using a consistent domain language. A challenge is interoping my domain ontology with other domain ontologies. The class name interop is an area where Tailwind has found success. You can start with their prototypes or another developer's prototype with copy/paste. This is great for engineers/developers who are less inclined to spend enough time learning the art of perfecting design.
This can happen in semantic markup as well, however the bounded context of the example site is less likely to interop with your app...because the semantic markup is less bounded than utility classes.
Tailwind also has `purge` to remove unused CSS classes. Yes, `purge` is a build step & it requires the js/html content to evaluate. However, if you want to optimize the JS bundle size, you probably use a build step.