clay
clay copied to clipboard
Change directions to angles in linearGradient. Otherwise the CSS com…
…es out
"linear-gradient(bottom, ..." rather than "linear-graident(to bottom, ...". With this we get "linear-gradient(180deg, ...".
I think linearGradient
and repeatingLinearGradient
are the only functions using this Direction
. Which means:
-
repeatingLinearGradient
has the same bug likelinearGradient
- we could just change the
Val
instance to your fix instead, essentially fixing both functions
Looking into https://www.w3schools.com/csSref/func_repeating-linear-gradient.asp, I'm actually getting the impression that Direction
is not defined in a sensible way to begin with. A better definition would be something like:
data Direction = DirectionSide Side | DirectionCorner Side side | DirectionAngle (Angle Deg)
instance Val Direction where
value (DirectionSide side) = "to " <> value side
...
(An even better definition would allow any kind of angle, not just degrees.)
But I can understand if redefining Direction
like that is too much for a quick fix PR.
Maybe we could write new tickets for further improvements.
True, then the best path forward is changing the Val
instance, I think.
Can you add a unit test for this?
uh oh I don't even remember what a linear gradient is :upside_down_face: