terribleMia’s avatarterribleMia’s Twitter Archive—№ 9,988

      1. I knew that "cyclic" variable dependencies are Invalid: html { --one: var(--two); /*❌*/ --two: var(--one); /*❌*/ } And I knew var() resolves before inheriting: html { --two: 0; --one: var(--two); /* 0 */ } body { --two: 2em; margin: var(--one); /* still 0 */ }
    1. …in reply to @TerribleMia
      Well… *Today I Learned* that means cyclic reference is allowed/avoided when nesting & inheritance are involved: html { --one: 10px; /* 10px */ } body { --two: calc(var(--one) + 10px); /* 20px */ } main { --one: calc(var(--two) + 10px); /* 30px */ } 🤯
  1. …in reply to @TerribleMia
    I still haven't found a use-case tho… I better spend the rest of my day/week on this, right?