Open juice49 opened 1 day ago
Hey,
Thanks! :)
Thank you. PR opened! (:
On @property
support:
@property
.syntax
descriptor could perhaps be used to enhance the created type (imagine a value that can be 'a' | 'b'
being typed that way).Having said that, it doesn't appear to be permissible to nest @property
at-rules. I think this puts a bit of a spanner in the works for discovery, because Mist would not be able to associate the at-rule with an element.
div[data-component="test"] {
@property --color {
syntax: "<color>";
inherits: false;
initial-value: rebeccapurple;
}
outline: 10rem solid var(--color);
}
@property --color {
syntax: "<color>";
inherits: false;
initial-value: rebeccapurple;
}
div[data-component="test"] {
outline: 10rem solid var(--color);
}
Some half baked thoughts:
var(--some-property)
versus --some-property: 1
)?@property
at-rule in order to create a more precise type based on its syntax
declaration?Maybe I'm overthinking it 😅.
I was really impressed to learn Mist generates types for CSS custom properties. However, I'm wondering why the resulting
style
object types are not optional. Especially because—as far as I can tell—Mist can only discover custom properties that have been declared with a default value in a style. Style consumers may not wish to override this default.CSS input
TypeScript output (
--color
is not optional)Questions
@property
at-rule for discovering custom properties, and perhaps inferring information about them?Love the work that's been done here ❤️.