— TIL

Today I Learnt

Small things worth writing down.

  1. CSS

    Cascade layers don't affect specificity between layers

    When you define @layer, the layer order determines priority — not specificity. A low-specificity rule in a later layer beats a high-specificity rule in an earlier one. Elegant once it clicks, deeply confusing until it does.

  2. Git

    git restore is the modern way to discard changes

    git checkout for discarding working directory changes has been superseded by git restore. Less ambiguous — checkout does too many different things depending on context. git restore --staged to unstage, git restore to discard.

  3. Eleventy

    Directory data files merge, not override

    If a file in a directory has tags in its own frontmatter and the directory data file also sets tags, Eleventy merges them — it doesn't pick one or the other. Bit of a gotcha when trying to move content between collections.