Recently enough, a project named You Might Not Need JS has seen the day. I have mixed opinions about it, and rather than writing a series of context-less tweets, I thought the sensible thing to do would be to write a couple of lines here.
Needless to say, this is obviously not meant as an offense to the project’s author, especially since I believe they (mostly) did a great job. More on that later.
A word about the inspiration
bind) which is obviously a Good Thing™.
Know your browser
<label for="color-picker">Select a colorlabel>
<input type="color" id="color-picker" />
color input type. Maybe only load a JS-powered color picker if it doesn’t.
Another good example is the form validation, with all the fancy HTML attributes allowing that (
A word on accessibility
A dialog element is not going to be accessible with CSS only. The
aria-hidden attribute needs to be toggled, the focus needs to be trapped, the escape key needs to close the dialog, and I could go on.
With that said, happy coding. ?