Tommy Hodgins Profile picture
Putting the “stan” in web standards • /frontend de(sign|velop)er/ • husband to @legalmoniker
Dec 1, 2018 21 tweets 23 min read
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! Dec 1: Parent Selector 🎄🎁 Though CSS doesn't have a :parent selector, you can create your own with a small JavaScript function and use a selector like [--parent] in your CSS stylesheets today!

demo: codepen.io/tomhodgins/pen…
code: npmjs.com/package/jsincs…

#css #javascript Supporting your own parent selector in CSS with [--parent]