The case for Weak Dependencies in JS
Exploring the benefits of weak dependencies in JavaScript libraries for progressive enhancement and smaller bundle sizes.
Lea Verou is a web standards expert, developer, and designer with a PhD from MIT in Human-Computer Interaction. She has worked as Product Lead at Font Awesome, helped shape the web as a member of the W3C Technical Architecture Group, and has been part of the CSS Working Group since 2012. Her open-source tools like PrismJS and Color.js are used by millions of developers worldwide. Lea is also the author of a bestselling CSS book, a frequent conference speaker, and an advocate for making technology simpler, more usable, and open for everyone.
210 articles from this blog
Exploring the benefits of weak dependencies in JavaScript libraries for progressive enhancement and smaller bundle sizes.
Creating pie charts in CSS using conic gradients with fallback styles for older browsers like IE11.
A CSS technique using a single custom property with a space value to toggle multiple style declarations on and off, enabling conditional styling.
A critique of Web Components' failure to simplify web development, arguing they became over-engineered and inaccessible.
A developer's chart on career priorities goes viral, sparking discussion on the evolution from making code work to valuing readability and avoiding over-abstraction.
Introducing Parsel, a tiny, permissive CSS selector parser with AST walking and specificity calculation methods.
Explains how to programmatically get a list of all CSS properties and identify shorthands and their longhands using the CSS Object Model (CSS OM).
Explains how to import non-ESM JavaScript libraries (globals, CommonJS) into ES Modules for client-side use, with practical examples.
Introducing MaVoice, a free Mavo app for voting on GitHub repo issues with one-click reactions and sorting by popularity.
Explores using the Cicada Principle with CSS variables and prime numbers to create pseudo-random visual patterns in web design.
Lessons from refactoring a large JavaScript codebase to use optional chaining, including patterns to search for and pitfalls to avoid.
A tutorial on creating a hybrid absolute/fixed positioning effect for a navigation sidebar using CSS variables and JavaScript.
A usability expert critiques the poor Developer Experience (DX) of modern JavaScript, highlighting common module import errors and tooling frustrations.
Explains LCH colors in CSS, their advantages over RGB/HSL, and browser implementation status for accessing wider color gamuts.
A tutorial on building a GitHub issue stats app using Mavo with HTML and CSS, requiring zero JavaScript.
A developer's tool for converting SVG path commands between all-relative and all-absolute formats, with a focus on easier path manipulation.
A developer's investigation into programmatically detecting 'x is not defined' ReferenceErrors in JavaScript across different browsers.
An improved CSS refresh bookmarklet that reloads stylesheets, including those within iframes, for web development.
A guide to creating dynamic regular expressions in JavaScript using tagged template literals and Proxies to simplify string escaping.
A developer explains a tricky bug caused by missing type="button" on generated buttons inside a form, leading to unexpected behavior.