Skip to content

Commit 77625e2

Browse files
committed
Add URL value type class.
1 parent 81d1c35 commit 77625e2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/CSS/Common.purs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class Hidden a where hidden :: a
2828
class Initial a where initial :: a
2929
class Unset a where unset :: a
3030

31+
class URL a where url :: String -> a
32+
3133
-- | The other type class is used to escape from the type safety introduced by
3234
-- embedding CSS properties into the typed world of purescript-css.
3335
-- `Other` allows you to cast any `Value` to a specific value type.
@@ -47,6 +49,8 @@ instance otherValue :: Other Value where other = id
4749
instance initialValue :: Initial Value where initial = fromString "initial"
4850
instance unsetValue :: Unset Value where unset = fromString "unset"
4951

52+
instance urlValue :: URL Value where url s = fromString ("url(\"" <> s <> "\")")
53+
5054
-------------------------------------------------------------------------------
5155

5256
-- | Common list browser prefixes to make experimental properties work in

0 commit comments

Comments
 (0)