Skip to content

Developer Insights

Join millions of viewers! Our engineers craft human-written articles solving real-world problems weekly. Enjoy fresh technical content and numerous interviews featuring modern web advancements with industry leaders and open-source authors.

Newest First
Svelte 5 is Here! cover image

Svelte 5 is Here!

Svelte 5 was finally released after a long time in development. Fortunately, we've been able to test it for some time, and now it has a stable release....

Introduction to Zod for Data Validation cover image

Introduction to Zod for Data Validation

As web developers, we're often working with external data that we don’t control and can’t expect to meet our expectations. But with the Zod library, we can define expected data schemas and validate incoming data against them....

Understanding the Difference Between `:focus` and `:focus-visible` in CSS cover image

Understanding the Difference Between `:focus` and `:focus-visible` in CSS

Understanding the Difference Between :focus and :focus-visible in CSS I have learned my fair share about the importance of keyboard accessibility, so I know that visual indication of the focused element is very important. But the well-known :focus pseudo-class is not always the best fit for this job. That's where :focus-visible comes in. Let's look at the differences between these two pseudo-classes and explore the best practices for using them effectively. What is the :focus Pseudo-Class? The :focus pseudo-class is a CSS selector that applies styles to any element that receives focus, regardless of how that focus was triggered. This includes focus events from keyboard navigation, mouse clicks, and touch interactions. Example Usage of :focus ` In this example, the button will display a blue outline whenever it is focused, whether the user clicks on it with a mouse, taps it on a touchscreen, or navigates to it using the keyboard. What is the :focus-visible Pseudo-Class? The :focus-visible pseudo-class is more specialized. It only applies styles to an element when the browser determines that the focus should be visible. This typically occurs when the user navigates via the keyboard or assistive technologies rather than through mouse or touch input. Example Usage of :focus-visible ` Here, the button will only show a blue outline when focused through keyboard navigation or another input method that usually requires visible focus indicators. Key Differences Between :focus and :focus-visible :focus - Behavior: Applies to any element that receives focus, regardless of the input method. - Use Cases: Ensures that all interactions with the element are visually indicated, whether by mouse, keyboard, or touch. :focus-visible - Behavior: Applies styles only when the focus should be visible, such as using a keyboard or assistive technology. - Use Cases: Ideal for scenarios where you want to provide focus indicators only to keyboard and assistive technology users while avoiding unnecessary outlines for mouse and touch users, typically required by design. Accessibility Implications :focus - Pros: - Guarantees that all users can see when an element is focused, which is critical for accessibility. - Cons: - Can lead to a suboptimal experience for mouse users, as focus styles may appear unnecessarily during mouse interactions. :focus-visible - Pros: - Enhances user experience by showing focus indicators only when necessary, thus keeping the interface clean for mouse and touch users. - Tailors the experience for keyboard and assistive technology users, providing them with clear visual cues. - Cons: - Additional considerations may be required to ensure that focus indicators are not accidentally omitted, especially in older browsers that do not support :focus-visible. - There may be cases where you want to show focus indicators for all users, regardless of input method. Best Practices for Using :focus and :focus-visible To achieve the best accessibility and user experience, combining both :focus and :focus-visible in your CSS is often a good idea. Combining :focus and :focus-visible ` Here is a Stackblitz example of what such styling could look like for you to try out and play with. Additional Tips - Test with Keyboard and Assistive Technology: Ensure that your web application is navigable using a keyboard (Tab, Shift + Tab, etc.) and that focus indicators are visible for those who rely on them. It's never a bad idea to include accessibility testing in your e2e testing suite. - Provide Clear Focus Indicators: Make sure that focus indicators are prominent and easy to see. A subtle or hard-to-spot focus indicator can severely impact accessibility for users who rely on keyboard navigation. Conclusion The :focus-visible pseudo-class offers a more refined way to manage focus indicators, improving accessibility and user experience, particularly for keyboard and assistive technology users. By understanding the differences between :focus and :focus-visible, and applying best practices in your CSS, you can create more accessible and user-friendly web applications. Remember, accessibility should never be an afterthought. By thoughtfully applying focus styles, you ensure that all users, regardless of how they interact with your site, can easily navigate and interact....

How to Create a Memorable Conference Experience with Vincent Mayers cover image

How to Create a Memorable Conference Experience with Vincent Mayers

In this episode of the Modern Web Podcast, Danny Thompson, Director of Technology at This Dot Labs, sits down with Vincent Mayers, a seasoned tech conference organizer with over 15 years of experience. They discuss the intricacies of running successful conferences, including the challenges of selecting event locations, building community engagement, and creating memorable experiences for attendees. Vincent also shares insights into the evolution of tech conferences, from the importance of shorter talks to the value of the "hallway track" for networking. Tune in for an inside look at how these events shape the tech ecosystem and tips for organizing your own conferences! Chapters - 00:00 - Introduction - 01:45 - Vincent Mayers' Background - 03:50 - Choosing Conference Locations - 06:10 - Building Community and Spreading the Word - 08:40 - Sponsorship and Funding Challenges - 11:00 - Securing Speakers for Tech Conferences - 14:20 - Improving the Conference Experience - 16:30 - Badge Design and the Attendee Experience - 18:50 - Engaging Attendees Beyond Talks - 21:00 - The Role of Tech Conferences in the Java Ecosystem - 23:12 - Attendees Still Using Older Java Versions - 26:00 - Balancing Cutting-Edge Tech with Fundamentals - 28:15 - Evolving Attention Spans in Tech Conferences - 30:00 - The Importance of the Hallway Track - 33:19 - Closing Remarks Follow Vincent Mayers on Social Media Twitter: https://x.com/vincentmayers Linkedin: https://www.linkedin.com/in/vincentmayers/ Github: https://github.com/vincentmayers Sponsored by This Dot....

The HTML Dialog Element: Enhancing Accessibility and Ease of Use cover image

The HTML Dialog Element: Enhancing Accessibility and Ease of Use

The new dialog element streamlines the implementation of accessible dialogs, modals, and other kinds of non-modal dialogs....

"How do I undo my most recent commit?" - Mastering the git reset command cover image

"How do I undo my most recent commit?" - Mastering the git reset command

Ever messed up a commit? Learn how to undo it like a pro! Our new blog post breaks down the git reset command, helping you navigate those "oops" moments with confidence....

Exploring Angular Forms: A New Alternative with Signals cover image

Exploring Angular Forms: A New Alternative with Signals

In the world of Angular, forms are essential for user interaction, whether you're crafting a simple login page or a more complex user profile interface....

How to build an AI assistant with OpenAI, Vercel AI SDK, and Ollama with Next.js cover image

How to build an AI assistant with OpenAI, Vercel AI SDK, and Ollama with Next.js

Learn how to run Llama 3.1 locally in a Next.js app, send audio to it, and play responses back to users....

How to Run End-to-End Tests on Vercel Preview Deployments cover image

How to Run End-to-End Tests on Vercel Preview Deployments

Learn how to run end-to-end (E2E) tests on Vercel preview deployments using GitHub Actions. This guide covers how to wait for deployments to be fully ready before executing tests, ensuring reliability and preventing false failures due to timing issues...

How to Truncate Strings Easily with CSS cover image

How to Truncate Strings Easily with CSS

Learn how to truncate text in CSS, focusing on single-line and multi-line truncation using properties like overflow, text-overflow, and -webkit-line-clamp. It highlights CSS’s simplicity and responsiveness compared to JavaScript-based truncation....

How User-Centric Design Motivates Developers with Paul McCollum cover image

How User-Centric Design Motivates Developers with Paul McCollum

Paul McCollum, author of "Practical Salesforce Architecture", shares his journey from microbiology to tech, discussing his work at Nortel Networks, and his transition into enterprise architecture with Salesforce. They explore the importance of empathy in engineering, how user-centric design motivates developers, and the evolution of agile development. Paul emphasizes solving real user problems over technical tasks and how continuous learning keeps work exciting. Chapters 1. Introduction – [00:00:00] 2. Early Career & Transition into Tech – [00:00:58] 3. The Evolution of Technology Stacks – [00:03:15] 4. Learning Through Play & Empathy – [00:04:52] 5. Agile Development & Challenges – [00:18:51] 6. Value-Driven Software Development – [00:21:23] 7. Avoiding Burnout in Tech Careers – [00:25:42] 8. Conclusion – [00:36:17] Follow Paul McCollum on Social Media Paul McCollum Linkedin: https://www.linkedin.com/in/realpaulmccollum/ Paul McCollum Twitter: https://x.com/uxaholic...

How to Take Extreme Ownership Over Your Engineering Efforts with Nate Emerson cover image

How to Take Extreme Ownership Over Your Engineering Efforts with Nate Emerson

Nate Emerson is a self-taught dev & a computer science university grad. In this episode, Nate talks about his unusual career trajectory, & what it taught him about the differences between being self-taught vs. formal education in software development....

Let's innovate together!

We're ready to be your trusted technical partners in your digital innovation journey.

Whether it's modernization or custom software solutions, our team of experts can guide you through best practices and how to build scalable, performant software that lasts.

Prefer email? hi@thisdot.co