Skip to content

Commit

Permalink
Change directions to angles in linearGradient. Otherwise the CSS come…
Browse files Browse the repository at this point in the history
…s out

"linear-gradient(bottom, ..." rather than "linear-graident(to bottom, ...".
With this we get "linear-gradient(180deg, ...".
  • Loading branch information
ddssff committed Jan 2, 2022
1 parent 0be3bcf commit 42ad693
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Clay/Gradient.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ type Ramp = [(Color, Size Percentage)]

linearGradient :: Direction -> Ramp -> BackgroundImage
linearGradient d xs = other $ Value $
let Value v = "linear-gradient(" <> value d <> "," <> ramp xs <> ")"
let Value v = "linear-gradient(" <> f (value d) <> "," <> ramp xs <> ")"
f (Value "top") = value (angular (deg 0))
f (Value "bottom") = value (angular (deg 180))
f (Value "left") = value (angular (deg 270))
f (Value "right") = value (angular (deg 90))
f a = a
in browsers <> v

hGradient, vGradient :: Color -> Color -> BackgroundImage
Expand Down

0 comments on commit 42ad693

Please sign in to comment.