-
Notifications
You must be signed in to change notification settings - Fork 74
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
Everything resolves to strings #90
Comments
Btw, this is the proper way to use it: export type LiteralUnion<T extends U, U = string> = T | (U & {}); |
Actually best approach wouod just to use |
A 'opt-out' type would be great, actually. Such as I don't use autocompletion, but allowing a strict value set, would certainly help to keep projects under control as tests would fail if using any value type which is not provided by either csstype or extended within the project itself. Commits that use new values types, would have to be declared on the extension file itself, making the reviewing process a breeze. |
Adding the string type to the union does not make much sense imo, you lose auto completion and type validation |
Second adding strict properties - a lot is lost with |
I agree, I'm also losing validation and intellisense because of the |
@frenic would you be okay with the introduction of a |
CSSType v3 new uses the You have to know that not all properties fallbacks with union string. Just the ones that needs it for obvious reasons like multiple values, lengths, URLs, functions etc. So the problem of having a separate "strict" version that doesn't fallback to union string at all is that it will result in lots of type errors for simple style like any of these: {
color: '#ffffff',
backgroundImage: 'url(path/to/an/image.jpg)',
fontSize: '10px',
} There's lots of examples like this were it will be more of a problem not having union string. |
I'm closing this because the original post was related to the autocompletion issue that is now fixed |
Should I open a new issue? My qualm is with properties like display allowing any string. |
@kylemh I may give it another try soon thanks to this which will make things a bit easier. At least support a fragment of different combinations so |
Understood. Thanks so much for the full context. Is there an issue or PR I can follow regarding the potential new attempt with contexts + template literals. |
Hi there!
It seems to me that all typing resolves to
string
?Example:
Since it can be a
string
that will override bothGlobals
andLineStyle
, not giving intellisense on the possible properties of the border style.Is this intentional?
I did some more research: microsoft/TypeScript#29729 (comment)
The text was updated successfully, but these errors were encountered: