Comment

Comment by fabiospampinato

As the maintainer of cash [0] I wouldn't recommend using these functions for almost anything, they aren't really alternatives for jQuery as they provide a very different API, just to give one example the proposed alternative for `$.fn.css`:

- Doesn't automatically camel-case the property name.

- Doesn't automatically vendor-prefix properties if needed.

- Doesn't support getting/setting CSS variables.

- Doesn't automatically add the `px` suffix to numeric values when appropriate.

- Doesn't fail gracefully when dealing with non-element nodes (`node.nodeType !== 1`).

IMHO there are too many details that you now have to think about when using such "native alternatives" that's not worth it. From my very unbiased opinion I think it makes more sense to just use cash, which only needs ~5kb when minified and gzipped, and can be even partially compiled to remove the stuff you don't need.

[0] https://github.com/kenwheeler/cash

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton