You no longer need JavaScript: an overview of what makes modern CSS so awesome
This intriguing article champions modern CSS, showcasing its powerful capabilities to build rich, interactive web experiences without relying on a single line of JavaScript. It resonates deeply with developers weary of JavaScript bloat, slow load times, and complex framework ecosystems. HN is buzzing with discussions about the true complexity of CSS and the viability of embracing browser-native solutions for more performant and elegant web development.
The Lowdown
The author, Lyra Rebane, presents a compelling case for minimizing JavaScript usage in web development, arguing that modern CSS has evolved significantly to handle many tasks traditionally relegated to JavaScript. The article positions JavaScript frameworks as often leading to bloat and inefficiency, proposing a return to more native web capabilities.
- Modern CSS is highlighted as a powerful, domain-specific programming language, dispelling the notion that it's merely a "glorified crayon" for basic styling.
- The piece details several recent, significant CSS enhancements, including native nesting, relative color functions, @starting-style for smooth animations, and advanced input validation with :user-valid/:user-invalid.
- It introduces new responsive viewport units (lvh, svh, dvh) designed to provide more reliable layout behavior across diverse mobile environments with dynamic UI elements like address bars.
- The author emphasizes performance benefits, noting that CSS animations often run on a separate compositor thread, ensuring smoother experiences even on low-end devices.
- A "CSS wishlist" section proposes future features like reusable styling blocks, combined @media selectors, and direct access to nth-child variables, demonstrating the author's vision for CSS evolution.
- The article concludes by framing web development, particularly CSS, as an artistic endeavor, advocating for creative expression over strict adherence to conventional tooling. Ultimately, the article serves as both an educational resource and a philosophical manifesto, encouraging web developers to rediscover and fully leverage the sophisticated capabilities of contemporary CSS for leaner, faster, and more accessible web applications.
The Gossip
No-JS Niche or Necessary?
Commenters debated the practical relevance of advocating for "no JavaScript" websites. While some argued it caters to a niche user base (e.g., "noscript-ians") and shouldn't be a primary driver for development choices, others strongly supported the principle, citing user preference and the general benefit of using platform capabilities. The discussion highlighted a tension between ideological purity and pragmatic development.
CSS Complexity Conundrum
A lively debate emerged regarding the inherent difficulty of CSS. Critics pointed to historically confusing properties (like float: clear) and inconsistent behaviors, asserting that CSS remains genuinely challenging. Conversely, proponents argued that modern CSS features have simplified many common tasks, making it much easier to write and understand, and that perceived difficulty often stems from outdated knowledge or different cognitive styles.
Modern CSS Mastery & More
This theme reflects a positive outlook on the evolution of CSS, with many expressing enthusiasm for its current capabilities. Commenters shared their successful adoption of modern CSS in conjunction with other lean web technologies like htmx. There was also a clear interest in identifying up-to-date learning resources to effectively grasp and apply these new features.