What exactly is :root selector in CSS?

Опубликовано: 21 Июнь 2023
на канале: CSS Weekly
7,062
217

A brief guide outlining how :root pseudo-class in CSS works, where it's often used and why, along with potential pitfalls.

🔗 Links
CodePen Demo: https://codepen.io/ZoranJambor/pen/Jj...
Custom Properties on :root Issue: https://github.com/w3c/csswg-drafts/i...
::selection background not visible issue: https://github.com/eslint/eslint.org/...

📖 Timestamps
00:00 What is :root pseudo-class
01:06 How :root in SVG works
03:21 Tip: Don’t define all your variables on :root
04:23 Pitfalls with :root inheritance
05:09 Should you use :root in your CSS?

Subscribe to CSS Weekly Newsletter:
💌 https://css-weekly.com/

Course Mastering Prettier & Stylelint
🔥 Learn everything about best linting tools while supporting CSS Weekly: https://masteringlinting.com/
🏷️ Use coupon code YOUTUBE15 to get an additional 15% off on the already discounted, pre-launch price.

Keep up-to-date with CSS Weekly:
👉 Twitter:   / cssweekly  
👉 Instagram:   / cssweekly  
👉 Facebook:   / cssweekly  

Keep up to date with what I'm up to:
🔗 Blog: https://zoranjambor.com
👉 Twitter:   / zoranjambor  
👉 LinkedIn:   / zoranjambor  

Zoran Jambor
#css #cssselectors


Смотрите видео What exactly is :root selector in CSS? онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь CSS Weekly 21 Июнь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 7,062 раз и оно понравилось 217 людям.