zachleat’s avatarzachleat’s Twitter Archive—№ 25,364

  1. Does anyone know if there is an efficient way to detect when a CSS Custom Property’s value changes in JavaScript? I want to change values at different breakpoints in the CSS but also run some JS when those properties change (without duplicating breakpoints in JS)
    1. …in reply to @zachleat
      (a question borne from this thread @snookca/1118304267759177728)
      1. …in reply to @zachleat
        @derSchepp dropped a lovely Houdini demo of this using the CSS Properties and Values API @derSchepp/1118609215835258882 w3.org/TR/css-properties-values-api-1/ More info on this API in this blog post from @bobrov1989 bobrov.dev/blog/css-custom-properties-in-depth/