DEV Community

loading...

Discussion on: Let's create a custom toggle switch using HTML and CSS.

Collapse
francisprovost profile image
Francis Provost

Really nice! I love that you used :checked instead of using some JS.

Don't forget to make it accessible to screen readers.
For that I would replace the label by a span. The input would be labelled somewhere else in the form. I would add aria-hidden on the span. That way screen readers will ignore the svgs that are not important for to understand the input.

Collapse
devggaurav profile image
Gaurav Author

Hey, thanks! I will surely make these changes.😄