Skip to content
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

display should not allow an arbitrary string #8

Closed
pelotom opened this issue Feb 12, 2018 · 6 comments · May be fixed by #22
Closed

display should not allow an arbitrary string #8

pelotom opened this issue Feb 12, 2018 · 6 comments · May be fixed by #22

Comments

@pelotom
Copy link
Collaborator

pelotom commented Feb 12, 2018

What is the | string for here?

type DisplayProperty = All | DisplayOutside | DisplayInside | DisplayInternal | DisplayBox | DisplayLegacy | string;

@frenic
Copy link
Owner

frenic commented Feb 12, 2018

According to spec, the syntax tells us that you're able to use space separated values. So fallback to string is necessary. But a goal I have is that display won't do that so I'm currently experimenting of combining data types with keywords to prevent that. So the result will be like: 'block' | 'flow' | 'block flow' | 'flow block' | ...

@pelotom
Copy link
Collaborator Author

pelotom commented Feb 12, 2018

Ah, I never knew display supported multiple values.

@ben-x9
Copy link

ben-x9 commented Jul 9, 2018

I was about to post the same issue for alignItems and justifyContent. I take it these need to support multiple values too?

@ben-x9
Copy link

ben-x9 commented Jul 9, 2018

Exposing an AlignItemsSingle type would be useful for disabling multiple values in certain contexts where you're sure you don't need it. E.g.:

export type AlignItemsSingleProperty = Globals | SelfPosition | "baseline" | "normal" | "stretch";
export type AlignItemsProperty = AlignItemsSingleProperty | string;

@frenic
Copy link
Owner

frenic commented Jul 10, 2018

I've started working on combined keywords #22 but halted partly due to #51. I'm afraid that it may have impact on performance if unions increase to an unsustainable amount. I could however limit that some how if that becomes a problem.

Too many type aliases seems to have an impact on performance too. So I'm a bit conservative to splitting them up.

I'll try to resume my work on combined keywords. To at least try it out. But I haven't come that far so anyone is welcome to submit a PR.

@frenic
Copy link
Owner

frenic commented Nov 5, 2019

Fixed in #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants