Comments on: You really don’t have to put your CSS custom properties in :root {} https://frontendmasters.com/blog/you-really-dont-have-to-put-your-css-custom-properties-in-root/ Helping Your Journey to Senior Developer Fri, 29 Aug 2025 03:33:01 +0000 hourly 1 https://wordpress.org/?v=6.9 By: Joshua Byrd https://frontendmasters.com/blog/you-really-dont-have-to-put-your-css-custom-properties-in-root/#comment-38544 Fri, 29 Aug 2025 03:33:01 +0000 https://frontendmasters.com/blog/?p=6836#comment-38544 “quit being fancy” lol no I don’t think that I shall

]]>
By: Chris Coyier https://frontendmasters.com/blog/you-really-dont-have-to-put-your-css-custom-properties-in-root/#comment-37801 Fri, 22 Aug 2025 13:05:23 +0000 https://frontendmasters.com/blog/?p=6836#comment-37801 In reply to Andy Bell.

I don’t think :root does anything in a shadow dom web component though??

https://codepen.io/chriscoyier/pen/WbQJKge

It’s :host that kinda selects the “root” of a web component.

]]>
By: Andy Bell https://frontendmasters.com/blog/you-really-dont-have-to-put-your-css-custom-properties-in-root/#comment-37792 Fri, 22 Aug 2025 11:14:41 +0000 https://frontendmasters.com/blog/?p=6836#comment-37792 One thing that keeps me using :root is that sure, it’s gonna be <html> 99% of the time, but what happens if we’re in the shadow DOM if we do that?

Just feels safer and dare I say, scalable.

]]>