HTML and CSS: The Unsung Heroes in a JavaScript-Heavy World

In today’s tech landscape, JavaScript frameworks like React, Vue, and Next.js (and yes, maybe even Angular 😂🤫) reign supreme, often relegating HTML and CSS to the shadows. With `className` replacing the `style` attribute, it’s easy to think these foundational technologies are mere scaffolding. But as someone knee-deep in testing with tools like Cypress, Playwright, and Selenium, I’ve seen firsthand that HTML and CSS remain the steady heroes of modern software—vital for automation, accessibility, and keeping the whole show running smoothly.


The Testing Quirk That Proved Their Worth

Recently, while using Cypress, I hit a snag: I needed to find an element that might or might not exist, depending on API data, but it lacked distinct attributes. This wasn’t just a roadblock for my test automation—it also violated accessibility standards, so I sent it back to the dev team. But imagine a scenario where your team isn’t bound by such guidelines. Without precise, reliable HTML attributes like a consistent `class` or `id`, your tests might timeout or grab the wrong element. HTML attributes aren’t just markup—they’re the hooks that automated tests latch onto. A flaky DOM means flaky tests, and no amount of JavaScript wizardry can save you if the underlying structure is a mess.


Accessibility: Where HTML and CSS Shine

HTML and CSS also play a starring role in accessibility testing, an area often overlooked in a JavaScript-heavy world. Tools like the open-source Wick-A11y (a Cypress plugin) evaluate HTML attributes—think `aria-label`, `role`, or `alt`—to ensure a site is usable for everyone. Without clear, semantic HTML, accessibility checks fall apart, leaving you unable to assess what you can’t understand. CSS matters here too: a `display: none` or a misaligned `:focus` style can hide elements from screen readers or keyboard users, even if the JavaScript logic is flawless. HTML and CSS aren’t just the foundation—they’re the product, ensuring users aren’t excluded and the app holds up under scrutiny.


Why They Still Matter

In a world dominated by JavaScript frameworks, HTML and CSS remain the unsung heroes that keep automation and accessibility standing upright. They ensure tests run smoothly by providing a stable structure for automation tools to navigate. They make accessibility possible by enabling tools to evaluate inclusivity. And they hold the app together, ensuring that even the most complex React component has a reliable base to build on. The humble <div class="" style="" id=""> might seem like a relic, but it’s still pulling more weight than you might think.


Lessons for a JavaScript-Heavy World

  • Prioritize Semantic HTML: Use clear attributes like `class`, `id`, and `aria-label` to support both testing and accessibility.
  • Mind Your CSS: Avoid styles like `display: none` that can break accessibility for screen readers or keyboard users.
  • Build for Stability: Ensure the DOM is reliable to prevent flaky tests, no matter how complex the JavaScript logic gets.
  • Respect the Foundation: Treat HTML and CSS as critical components, not just scaffolding, to create robust, inclusive software.

HTML and CSS may not steal the spotlight in a JavaScript-heavy world, but they’re the steady heroes that keep modern software standing tall. From ensuring reliable test automation to enabling accessibility for all users, they remain the forgotten foundation that holds everything together. So, the next time you’re deep in a React component, spare a thought for these fundamentals—they’re doing more for your project’s success than you might realize.

@