atomic-css-0.1.0: Type-safe, composable CSS utility functions. Inspired by Tailwindcss and Elm-UI
Safe HaskellNone
LanguageGHC2021

Web.Atomic.Html

Synopsis

Documentation

data Html a Source #

Html monad

import Web.Atomic

example = do
  el ~ pad 10 $ do
    el ~ fontSize 24 . bold $ "My Links"
    a @ href "hoogle.haskell.org" ~ link $ "Hoogle"
    a @ href "hackage.haskell.org" ~ link $ "Hackage"

link = underline . color Primary
a = tag "a"
href = att "href"

Constructors

Html 

Fields

Instances

Instances details
Applicative Html Source # 
Instance details

Defined in Web.Atomic.Html

Methods

pure :: a -> Html a #

(<*>) :: Html (a -> b) -> Html a -> Html b #

liftA2 :: (a -> b -> c) -> Html a -> Html b -> Html c #

(*>) :: Html a -> Html b -> Html b #

(<*) :: Html a -> Html b -> Html a #

Functor Html Source # 
Instance details

Defined in Web.Atomic.Html

Methods

fmap :: (a -> b) -> Html a -> Html b #

(<$) :: a -> Html b -> Html a #

Monad Html Source # 
Instance details

Defined in Web.Atomic.Html

Methods

(>>=) :: Html a -> (a -> Html b) -> Html b #

(>>) :: Html a -> Html b -> Html b #

return :: a -> Html a #

Attributable (Html a) Source # 
Instance details

Defined in Web.Atomic.Html

Styleable (Html a) Source # 
Instance details

Defined in Web.Atomic.Html

Methods

(~) :: Html a -> (CSS (Html a) -> CSS (Html a)) -> Html a Source #

modCSS :: ([Rule] -> [Rule]) -> Html a -> Html a Source #

IsString (Html ()) Source # 
Instance details

Defined in Web.Atomic.Html

Methods

fromString :: String -> Html () #

IsList (Html ()) Source # 
Instance details

Defined in Web.Atomic.Html

Associated Types

type Item (Html ()) 
Instance details

Defined in Web.Atomic.Html

type Item (Html ()) = Node

Methods

fromList :: [Item (Html ())] -> Html () #

fromListN :: Int -> [Item (Html ())] -> Html () #

toList :: Html () -> [Item (Html ())] #

type Item (Html ()) Source # 
Instance details

Defined in Web.Atomic.Html

type Item (Html ()) = Node

el :: Html () -> Html () Source #

tag :: Text -> Html () -> Html () Source #

text :: Text -> Html () Source #

raw :: Text -> Html () Source #

data Element Source #

A single Html element. Note that the class attribute is generated separately from the css rules, rather than the attributes

Constructors

Element 

Fields

data Node Source #

Constructors

Elem Element 
Text Text 
Raw Text 

Instances

Instances details
IsString Node Source # 
Instance details

Defined in Web.Atomic.Html

Methods

fromString :: String -> Node #