Closed jmn closed 4 years ago
I think I figured my particular case out by looking at commits. Something like
{-# LANGUAGE OverloadedStrings, GeneralizedNewtypeDeriving #-}
import Clay
import Clay.Property
newtype ObjectFit = ObjectFit Value
deriving (Val, Inherit, Initial, Unset, Normal)
scaleDown :: ObjectFit
scaleDown = ObjectFit "scale-down"
objectFit :: ObjectFit -> Css
objectFit = key "object-fit"
I would think this is probably a a good pull request. But I agree, it might be worth mentioning how to add new properties. Is it really that simple as the code sample above?
As a quick workaround, there's the "object-fit" -: "scale-down"
option (take care when quoting, though) using -:
.
Happy to accept a PR adding this feature with docs.
Stale issue message
I'd like to do something like img{ object-fit: scale-down; }
But Clay doesn't seem to have objectFit. It would be most helpful to have a code example showing how to add a new property.