๐—–๐—ฆ๐—ฆ ๐—ฃ๐—ฎ๐—ฟ๐—ฒ๐—ป๐˜ ๐—ฆ๐—ฒ๐—น๐—ฒ๐—ฐ๐˜๐—ผ๐—ฟ ๐—ฎ๐—ป๐—ฑ ๐—–๐—ผ๐—ป๐—ฑ๐—ถ๐˜๐—ถ๐—ผ๐—ป๐—ฎ๐—น ๐—ฆ๐˜๐˜†๐—น๐—ถ๐—ป๐—ด

CSS now has a new way to style elements using the :has() pseudo-class.

This tool allows you to select a parent element based on its children. You no longer need JavaScript for many conditional styling tasks. For example, you can style a form group only when an input inside it is invalid.

To build better software, follow these rules:

Mastering these skills takes time. Start with the basics and practice every day. Learn from your mistakes and share your knowledge with your team.

Your task for this week: Audit your current workflow. Find one small gap and fix it.

Source: https://dev.to/therizwansaleem/css-has-selector-parent-selection-and-conditional-styling-without-javascript-p78