I misunderstood how xstyled's css function interacts with emotion's css function, so I added this complicated code in c400c70775be09033c65cb3626ce1a683198546d.
More recently, while working on #250, I discovered that it's also broken, because it converts a function argument into an array.
This simpler code does the one thing it needs to do: concat string separators to the tagged template literal corresponding to the number of generators.
It also produces a slightly more efficient result, because it does more work up front (testing generators.length and concatting arrays) before the resulting function, rather than every time the function runs.
Test plan
Updated styled.test.tsx to run some tests in common between styled.div and styled.box. Without this fix, the test "works with css as object and function prop" fails for styled.box
Summary
I misunderstood how xstyled's css function interacts with emotion's css function, so I added this complicated code in c400c70775be09033c65cb3626ce1a683198546d.
More recently, while working on #250, I discovered that it's also broken, because it converts a function argument into an array.
This simpler code does the one thing it needs to do: concat string separators to the tagged template literal corresponding to the number of generators.
It also produces a slightly more efficient result, because it does more work up front (testing
generators.length
and concatting arrays) before the resulting function, rather than every time the function runs.Test plan
Updated
styled.test.tsx
to run some tests in common betweenstyled.div
andstyled.box
. Without this fix, the test "works with css as object and function prop" fails forstyled.box