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

Arrays create multiple properties, not multiple values #33

Closed
mostafah opened this issue Oct 5, 2016 · 2 comments
Closed

Arrays create multiple properties, not multiple values #33

mostafah opened this issue Oct 5, 2016 · 2 comments
Labels

Comments

@mostafah
Copy link

mostafah commented Oct 5, 2016

It seems like passing in { background: ['linear-gradient(to right, red 0%, blue 100%)', 'url(image.png)'] } creates this:

    background-color: linear-gradient(to right, red 0%, blue 100%);
    background-color: url(image.png);

Doesn’t that just ignore the first one? I guess it should be like this:

    background-color: linear-gradient(to right, red 0%, blue 100%), url(image.png);

This is happening in styleToString. I have not worked with TS before, but I guess I can send a PR if you agree with the change.

@blakeembrey
Copy link
Owner

blakeembrey commented Oct 5, 2016

No, the first behaviour is correct. It's designed to support the common use-case of CSS overloads. E.g. vendor prefix property overloads, feature overloads (where browsers use the first understood value), etc. This is documented in the README - see https://github.com/blakeembrey/free-style#multiple-css-values. I can see how the title may be confusing - does "Overload CSS Properties" sound better?

@mostafah
Copy link
Author

mostafah commented Oct 6, 2016

I see the point of this behavior now. You are right: “multiple values” reminds me of my second example, and that’s why I thought this is bug. “Overloading properties” sounds like the correct term to me.

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

No branches or pull requests

2 participants