Regular reminder that #CSS is already typed. We don't need any libraries for adding types to CSS or trying to add them through JS.
It is just that the IDEs, tooling, etc. should pick up the slack and actually use that information.
The types of non-registered custom properties can also be inferred from their usage in 99% of cases, and if there are name conflicts, it will likely be a bigger issue in a project anyways. So that's something tooling should be able to do (analyze all CSS and infer).