Best of CSS-TricksJuly 2024

  1. 1
    Article
    Avatar of css_tricksCSS-Tricks·2y

    CSS Selectors

    CSS is highly effective in selecting and styling elements. It provides various selector types, such as universal, type, class, ID, and attribute selectors, each serving different specificity needs. CSS combinators, like descendant, child, general sibling, and adjacent sibling combinators, help refine selections. Pseudo-selectors target pseudo-elements for additional styling without altering HTML. Understanding specificity and combining selectors enhances CSS expertise and maintainability.

  2. 2
    Article
    Avatar of css_tricksCSS-Tricks·2y

    “If” CSS Gets Inline Conditionals

    The CSS Working Group (CSSWG) has resolved to add the if() conditional to the CSS Values Module Level 5 specification. The proposal, led by Lea Verou, aims to allow styles to be applied based on conditional requirements. This conceptual feature could enable inline conditionals with selectors, transforming how styles are applied. The syntax involves specifying conditions and setting style values based on those conditions. The feature is still under development, with ongoing discussions and potential changes.