ckirknielsen’s avatarckirknielsen’s Twitter Archive—№ 971

  1. …in reply to @LeaVerou
    LeaVerou Okay I tested it this time… --min: 2px; --val: 1vw; --gap: calc( max( var(--val) - var(--min) * 2, calc(var(--min) * -1) ) + var(--min)); I think?
    1. …in reply to @ckirknielsen
      LeaVerou I think I got the maths to work in JS but I am not writing proper CSS (which sucks given it's my job): codepen.io/chriskirknielsen/pen/dyWmBvO Anyways, great challenge! I'm just not up to snuff. :(
      OpenGraph image for codepen.io/chriskirknielsen/pen/dyWmBvO
    2. …in reply to @ckirknielsen
      LeaVerou Wait, nope. If --val == 3px, it yields 1px. This is a good question. 😅