Continued with our journey of creating an accessible Modal component in React part 2.
- Focus placement when the modal is open
- Returning focus to the element that invoked it
- Closing modal when the `Esc` key is pressed
- Focus trap
- Scroll Lock
amanexplains.com/how-to-crea…
Creating a modal dialog from scratch can be challenging, considering the UX and accessibility of it. I have taken a crack at it and written an article to explain things in parts.
amanexplains.com/how-to-crea…
1
Aman Singh retweeted
:has() + container queries = the component-based logical styling we've always dreamed of 😍
In this demo:
🖼 If the card has an image: make the font smaller & at < 400px wide, stack it
✨ If no image: bigger font, no stacking
codepen.io/una/pen/oNpoqGp
⚠️ Need flags on in Canary
Have you ever had trouble understanding how HTML elements are stacked? What role does `z-index` play?
I wrote a small article unveiling the stacking rules for the HTML elements. This will aid in your journey of demystifying how z-index works.
amanexplains.com/stacking-ru…
Thank you @helloworldless for writing this helpful article.
Gatsby Starter Blog: How to Add Header Images to Posts with Support for Twitter Cards
freecodecamp.org/news/gatsby…
1
Aman Singh retweeted
Do not use aria-hidden on content that can be focusable (including tabindex=-1)
But tbh, think really hard about using aria-hidden in general. Why are you specifically trying to hide visible content from AT users?
Sometimes it is necessary. Many times it is incorrectly used.
Aman Singh retweeted
🧪 Use CSS numeric factory functions instead of string concatenation to set style unit values.
developer.mozilla.org/en-US/…
Aman Singh retweeted
Personal take: a lot of things would suck less if design systems and JS frameworks weren’t so tightly coupled.
Aman Singh retweeted
The new React docs are out!
Well-written and practical, complete with interactive examples, diagrams, and more. Plus, they teach Hooks first.
Give them a read and provide feedback: beta.reactjs.org
Aman Singh retweeted
Safari now supports `enterkeyhint`. 👏
I always like it when the enter key gives me more context. 👇
🔗 Spec: html.spec.whatwg.org/multipa…
#devsheets
Accessible Authentication and Redundant Form entry are some interesting success criterion being added in the new WCAG 2.2.
Web should be inclusive and accessible to everyone.
visionaustralia.org/services…
1
Aman Singh retweeted
#1: Know the 8 ways to handle state, and when to consider each.
Just got my ticket for #nextjsconf by @vercel, claim yours!
Let's make the Web. Faster.
nextjs.org/conf/tickets/oct2…
1
Aman Singh retweeted
Create image carousel using 2 lines of CSS. 🚀📷
🖇 codepen.io/prathkum/pen/bGBO…
Aman Singh retweeted
Clever! Love this #CSS tip 👇🏻
Aman Singh retweeted
The Big Gotcha With Custom Properties
css-tricks.com/the-big-gotch…
Creating an accessible component is not as hard as you think. It only requires the right attitude and a bit of empathy for your users.
Written an article for my fellow react developers, but the idea can be applied to vanilla JS implementation too.
amanexplains.com/how-to-crea…
Aman Singh retweeted
Vim is probably the only text editor with the
:smile
command! :)
:: masteringvim.com ::



















