postcss-jit-props icon indicating copy to clipboard operation
postcss-jit-props copied to clipboard

props changed in `@supports` aren't injected

Open argyleink opened this issue 7 months ago • 1 comments

To support @supports, new hooks need added to both the postcss plugin and OpenProps https://github.com/argyleink/open-props/issues/556. Follow the pattern that @media setup,

argyleink avatar May 12 '25 18:05 argyleink

i started this work in a cloud IDE with ai code assist, and now it wont push my branch… i got the test written but havent found a solution:

const MockProps = {
  …
  '--gradient-space': '',
  '--gradient-auto-hdr': 'linear-gradient(to right var(--gradient-space), #48005c, #8300e2)',
  '--gradient-auto-hdr-@supports': '@supports (background: linear-gradient(to right in oklab, #000, #fff)) {:where(html) {--gradient-space: in oklab;}}',
}

it('Can jit @supports', async () => {
  await run(
`:root {
  background: var(--gradient-auto-hdr);
}`, 
`:root {
  --gradient-space: '';
  --gradient-auto-hdr: linear-gradient(to right var(--gradient-space), #48005c, #8300e2);
  background: var(--gradient-auto-hdr);
}
@supports (background: linear-gradient(to right in oklab, #000, #fff)) {
  :root {
    --gradient-space: in oklab;
  }
}`, 
  MockProps
  )
})

argyleink avatar May 12 '25 19:05 argyleink