terribleMia’s avatarterribleMia’s Twitter Archive—№ 7,312

  1. …in reply to @jina
    jina Custom props will only inherit the value of that custom property, at the point inherit is declared. It will not re-calculate when applied: html { --color: red; color: green; } body { --color: inherit; color: blue; } main { color: var(--color); } ^ red
    1. …in reply to @TerribleMia
      jina (since custom props inherit by default, this is only really useful as a way to unset another value.)
    2. …in reply to @TerribleMia
      jina the variable carries the value of its calculated inheritance, not the keyword "inherit" same is true with things like calc() inside custom props - the computed value inherits, rather than the function being re-calculated for a new context