I hit the same issue, confused as to why prop: var(--custom); remains after var resolution, but not :root { --custom: val; }. It seems the default functionality should be to include the definitions block, at the very least when preserve: true. That said, I can see how this might break backwards compatibility, so what about an option to import the declarations? The alternative seems incredible dirty—generating a file just to reimport it. In fact, that solution causes infinite refreshes with hot reloading, generating and importing the same file every loop.
This follows https://github.com/postcss/postcss-custom-properties/issues/155
I hit the same issue, confused as to why
prop: var(--custom);
remains after var resolution, but not:root { --custom: val; }
. It seems the default functionality should be to include the definitions block, at the very least whenpreserve: true
. That said, I can see how this might break backwards compatibility, so what about an option to import the declarations? The alternative seems incredible dirty—generating a file just to reimport it. In fact, that solution causes infinite refreshes with hot reloading, generating and importing the same file every loop.