Skip to main content Accessibility Feedback

Extending CSS with vanilla JavaScript

These days, people love to write CSS in JavaScript. But my buddy Tommy Hodgins is doing something really crazy: extending CSS features with JavaScript.

This year for #merryCSSmas I’ll be covering some of the most requested styling features and how they can be used with CSS. This will be a month-long series showing ways that simple, valid CSS, and simple JavaScript functions can work together to style anything you can imagine!

Ever wish CSS had a :parent or :closest selector, like you can with JavaScript?

In this series, Tommy shows you how you can use a little vanilla JS to bolt features into CSS that you wish existed but don’t. This is not CSS-in-JS. You write your CSS in CSS, but use JavaScript to extend it with new features. Super cool stuff!

Check out the series all December on this Twitter thread.