You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, I don't understand why ScssPhp\ValueConverter::fromPhp assumes scalar types are purely from PHP (correct) but array types are potentially Scss values (unexpected for me, bordering to wrong). Especially when one has to look at the code to figure that out.
The hard part is that we already support passing an already converted value there (due to some legacy behavior in the library), and those are represented as an array.
Well, actually, support converted values in that one is something I want to keep, because it will make it simpler when releasing 2.0 that will introduce the modern representation of values. When passed with a legacy value (the current ones), it will convert it to modern ones. So we cannot deprecate it.
First of all, I don't understand why
ScssPhp\ValueConverter::fromPhp
assumes scalar types are purely from PHP (correct) but array types are potentially Scss values (unexpected for me, bordering to wrong). Especially when one has to look at the code to figure that out.scssphp/src/ValueConverter.php
Line 65 in 957888e
Secondly, the function signature takes in "mixed" type - nowhere does it say anything about objects or arrays not being supported.
Thirdly, this functionality is a very common use case (when it comes to custom variables), so it really should be implemented. 😅
I tried the following approach but it didn't work:
I don't have much knowledge about these types' structure to be sure about that code, would be nice if someone could figure out what's wrong.Seems the code does work 🤔 maybe it could be added to the implementation though..
The text was updated successfully, but these errors were encountered: