4 ms·
You might not need jQuery (https://youmightnotneedjquery.com/ https://youmightnotneedjquery.com/) shows pure JS implementations of common jQuery methods. Someon
by divbzero 3y ago
You might not need jQuery (https://youmightnotneedjquery.com/ https://youmightnotneedjquery.com/) shows pure JS implementations of common jQuery methods. Someone should create an analogous You might not need SASS to help developers move to pure CSS.
- chris_wot 3y agoI recently recreated a website that used a lot of jquery. I didn’t use any JavaScript, it was all CSS.
- asah 3y agosweet! but alas, I'm looking through the examples and one line of simple+clear JQuery is a often a dozen tricky lines of pure CSS.
- divbzero 3y agoI usually take it as suggestive code that you don’t have to use verbatim. For example, You might not need jQuery offers the following suggestions: // toggle visibility function toggle(el) { if (el.style.display == 'none') { el.style.display = ''; } else { el.style.display = 'none'; } } // remove multiple elements for (const el of document.querySelectorAll(selector)) { el.remove(); } While the following would be more concise: // toggle visibility function toggle(el) { el.style.display = el.style.display === 'none' ? '' : 'none; } // remove multiple elements document.querySelectorAll(selector).forEach(el => el.remove());