{-# LANGUAGE
GeneralizedNewtypeDeriving
, OverloadedStrings
, NoImplicitPrelude
#-}
module Clay.Dynamic
(
UserInput
, userInput
, inputEnabled, inputDisabled
, UserModify
, userModify
, readOnly, readWrite, writeOnly
, UserSelect
, userSelect
, selectText, selectToggle, selectElement, selectElements
, UserFocus
, userFocus
, selectAll, selectBefore, selectAfter, selectSame, selectMenu
)
where
import Clay.Common
import Clay.Property
import Clay.Stylesheet
import Data.Monoid hiding (All)
userInput :: UserInput -> Css
userInput = prefixed (browsers <> "user-input")
newtype UserInput = UserInput Value
deriving (Val, Inherit, None)
inputEnabled, inputDisabled :: UserInput
inputEnabled = UserInput "enabled"
inputDisabled = UserInput "disabled"
userModify :: UserModify -> Css
userModify = prefixed (browsers <> "user-modify")
newtype UserModify = UserModify Value
deriving (Val, Inherit)
readOnly, readWrite, writeOnly :: UserModify
readOnly = UserModify "readonly"
readWrite = UserModify "read-write"
writeOnly = UserModify "write-only"
userSelect :: UserSelect -> Css
userSelect = prefixed (browsers <> "user-select")
newtype UserSelect = UserSelect Value
deriving (Val, Inherit, None, All)
selectText, selectToggle, selectElement, selectElements :: UserSelect
selectText = UserSelect "text"
selectToggle = UserSelect "toggle"
selectElement = UserSelect "element"
selectElements = UserSelect "elements"
userFocus :: UserFocus -> Css
userFocus = prefixed (browsers <> "user-focus")
newtype UserFocus = UserFocus Value
deriving (Val, Inherit, None, Normal, Auto)
selectAll, selectBefore, selectAfter, selectSame, selectMenu :: UserFocus
selectAll = UserFocus "select-all"
selectBefore = UserFocus "select-before"
selectAfter = UserFocus "select-after"
selectSame = UserFocus "select-same"
selectMenu = UserFocus "select-menu"