terribleMia’s avatarterribleMia’s Twitter Archive—№ 6,141

    1. What color is this text in browsers… with var support / without var support? html { color: blue; color: var(--undefined); }
  1. …in reply to @TerribleMia
    This poll is holding steady, with correct "default/blue" ~20% 1. Invalid/unknown *declarations* can't be parsed, & are ignored—falling back to previous declarations 2. Invalid/undefined *variables* parse, but fail to compute later—falling back to unset codepen.io/mirisuzanne/pen/OYoVLX
    1. …in reply to @TerribleMia
      This behavior is defined in the spec (w3.org/TR/css-variables-1/#invalid-variables) because parsing-time & computed-value-time have different restrictions. But it also gives us the ability to handle 2 distinct fallback paths – one with var() support, and one without.
      1. …in reply to @TerribleMia
        Parsed-but-not-computed values are kinda cool—like null in Sass, or undefined in JS—for handling set/unset, as distinct from variable/non-variable. You can also make that explicit, using unset or any invalid value for your context. See line 41: codepen.io/mirisuzanne/pen/BEvjbm