-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Usage for generating types for variables (e.g. a "variables.scss") #216
Comments
+1 have you found anything yet @fullyherge? |
Sadly no. We worked around it for now. |
This package primarily focuses on supporting CSS Modules which primarily considers CSS classes as the public API. Since these aren't exported producing types outside of this is out of scope. If this is a common enough pattern I could see a reason to include it. If we were to consider supporting it, I'd probably prefer still relying on "CSS Modules Public API", which includes the |
Makes sense! As it works now, though it doesn't seem well supported, for example: $shades: ("light", "dark");
:export {
shades: $shades;
} Generates export declare const shades: string; I assume the issue here is that |
You're saying it's outputting string instead of a union of the two specific strings? I think we can add logic to try to make this more strict for this case and fallback to string |
Yeah exactly |
We have a maybe irrelevant for this package use case in which we mostly want to generate type definitions for our variables.
For example we would like this
.scss
:to generate something like this
.d.ts
Is this completely out of the scope of this package? If no, how would I accomplish this? If yes, does anyone know any library for doing something like this?
The text was updated successfully, but these errors were encountered: