Shpadoinkle-html-0.3.0.2: A typed, template generated Html DSL, and helpers.

Safe HaskellNone
LanguageHaskell2010

Shpadoinkle.Html.Property

Description

This module provides a DSL for HTML properties This DSL is entirely optional. You may use the Prop constructors provided by Shpadoinkle core and completely ignore this module. For those who like a typed DSL with named functions for different properties and nice overloading, this is for you.

Unlike Events and Elements, Properties come in one flavor: Vanilla.

Each named function documents the type of property it constructs, whether it be Text or Bool. We also support other types such as Int and Float, but via converting them to Text and letting JavaScript weirdness cast them to the correct underlying type.

Synopsis

Documentation

class ToPropText a where Source #

How do we take a non-textual value, and make it text which JavaScript will cast appropriately?

Methods

toPropText :: a -> Text Source #

Instances
ToPropText Bool Source # 
Instance details

Defined in Shpadoinkle.Html.Property

Methods

toPropText :: Bool -> Text Source #

ToPropText Float Source # 
Instance details

Defined in Shpadoinkle.Html.Property

ToPropText Int Source # 
Instance details

Defined in Shpadoinkle.Html.Property

Methods

toPropText :: Int -> Text Source #

ToPropText Text Source # 
Instance details

Defined in Shpadoinkle.Html.Property

Methods

toPropText :: Text -> Text Source #

textProperty :: ToPropText a => Text -> a -> (Text, Prop m b) Source #

newtype ClassList Source #

Constructors

ClassList 

Fields

Instances
Eq ClassList Source # 
Instance details

Defined in Shpadoinkle.Html.Property

Ord ClassList Source # 
Instance details

Defined in Shpadoinkle.Html.Property

Show ClassList Source # 
Instance details

Defined in Shpadoinkle.Html.Property

IsString ClassList Source # 
Instance details

Defined in Shpadoinkle.Html.Property

Semigroup ClassList Source # 
Instance details

Defined in Shpadoinkle.Html.Property

Monoid ClassList Source # 
Instance details

Defined in Shpadoinkle.Html.Property

ClassListRep ClassList Source # 
Instance details

Defined in Shpadoinkle.Html.Property

ClassListRep (ClassList, Bool) Source # 
Instance details

Defined in Shpadoinkle.Html.Property

class ClassListRep a where Source #

Methods

asClass :: a -> ClassList Source #

Instances
ClassListRep Text Source # 
Instance details

Defined in Shpadoinkle.Html.Property

ClassListRep ClassList Source # 
Instance details

Defined in Shpadoinkle.Html.Property

ClassListRep cl => ClassListRep [cl] Source # 
Instance details

Defined in Shpadoinkle.Html.Property

Methods

asClass :: [cl] -> ClassList Source #

ClassListRep (Text, Bool) Source # 
Instance details

Defined in Shpadoinkle.Html.Property

Methods

asClass :: (Text, Bool) -> ClassList Source #

ClassListRep (ClassList, Bool) Source # 
Instance details

Defined in Shpadoinkle.Html.Property

class' :: ClassListRep cl => cl -> (Text, Prop m a) Source #

for' :: Text -> (Text, Prop m a) Source #

styleProp :: [(Text, Text)] -> (Text, Prop m a) Source #

px :: (Num a, Show a) => a -> Text Source #

toEm :: (Num a, Show a) => a -> Text Source #

rem :: (Num a, Show a) => a -> Text Source #

reversed :: Bool -> (Text, Prop m a) Source #

default' :: Bool -> (Text, Prop m a) Source #

usemap :: Bool -> (Text, Prop m a) Source #

ismap :: Bool -> (Text, Prop m a) Source #

required :: Bool -> (Text, Prop m a) Source #

readonly :: Bool -> (Text, Prop m a) Source #

multiple :: Bool -> (Text, Prop m a) Source #

loop :: Bool -> (Text, Prop m a) Source #

controls :: Bool -> (Text, Prop m a) Source #

autoplay :: Bool -> (Text, Prop m a) Source #

disabled :: Bool -> (Text, Prop m a) Source #

hidden :: Bool -> (Text, Prop m a) Source #

selected :: Bool -> (Text, Prop m a) Source #

checked :: Bool -> (Text, Prop m a) Source #

lang :: Text -> (Text, Prop m a) Source #

property :: Text -> (Text, Prop m a) Source #

content :: Text -> (Text, Prop m a) Source #

charset :: Text -> (Text, Prop m a) Source #

itemprop :: Text -> (Text, Prop m a) Source #

dropzone :: Text -> (Text, Prop m a) Source #

manifest :: Text -> (Text, Prop m a) Source #

pubdate :: Text -> (Text, Prop m a) Source #

datetime :: Text -> (Text, Prop m a) Source #

scope :: Text -> (Text, Prop m a) Source #

headers :: Text -> (Text, Prop m a) Source #

align :: Text -> (Text, Prop m a) Source #

srcdoc :: Text -> (Text, Prop m a) Source #

sandbox :: Text -> (Text, Prop m a) Source #

srclang :: Text -> (Text, Prop m a) Source #

kind' :: Text -> (Text, Prop m a) Source #

name' :: Text -> (Text, Prop m a) Source #

poster :: Text -> (Text, Prop m a) Source #

preload :: Text -> (Text, Prop m a) Source #

alt :: Text -> (Text, Prop m a) Source #

coords :: Text -> (Text, Prop m a) Source #

shape :: Text -> (Text, Prop m a) Source #

ping :: Text -> (Text, Prop m a) Source #

media :: Text -> (Text, Prop m a) Source #

hreflang :: Text -> (Text, Prop m a) Source #

download :: Text -> (Text, Prop m a) Source #

target :: Text -> (Text, Prop m a) Source #

wrap :: Text -> (Text, Prop m a) Source #

step :: Text -> (Text, Prop m a) Source #

min :: Text -> (Text, Prop m a) Source #

max :: Text -> (Text, Prop m a) Source #

pattern :: Text -> (Text, Prop m a) Source #

method :: Text -> (Text, Prop m a) Source #

enctype :: Text -> (Text, Prop m a) Source #

action :: Text -> (Text, Prop m a) Source #

accept :: Text -> (Text, Prop m a) Source #

title :: Text -> (Text, Prop m a) Source #

src :: Text -> (Text, Prop m a) Source #

value :: Text -> (Text, Prop m a) Source #

href :: Text -> (Text, Prop m a) Source #

rel :: Text -> (Text, Prop m a) Source #

type' :: Text -> (Text, Prop m a) Source #

id' :: Text -> (Text, Prop m a) Source #

minLength :: Int -> (Text, Prop m a) Source #

maxLength :: Int -> (Text, Prop m a) Source #

height :: Int -> (Text, Prop m a) Source #

width :: Int -> (Text, Prop m a) Source #

tabIndex :: Int -> (Text, Prop m a) Source #

newTab :: (Text, Prop m a) Source #