GoogleChromeLabs / postcss-jit-props

A CSS custom property helper based on PostCSS. Supply a pool of variables and this plugin will add them to the stylesheet as they are used.
https://stackblitz.com/edit/jit-open-props?file=postcss.config.js
Apache License 2.0
210 stars 9 forks source link

access first child with optional chaining #49

Closed dtl closed 1 month ago

dtl commented 1 month ago

A node does not always have a first child. As an example, empty <styles> in a Svelte components throw an error because first child attributes are accessed directly even if the first child is undefined (or null).

This may also fix #40