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

Web.Atomic.CSS.Box

Synopsis

Documentation

pad :: Styleable h => Sides Length -> CSS h -> CSS h Source #

Space surrounding the children of the element

To create even spacing around and between all elements combine with gap

el ~ flexCol . pad 10 . gap 10 $ do
  el "one"
  el "two"
  el "three"

gap :: Styleable h => Length -> CSS h -> CSS h Source #

The space between child elements. See pad

margin :: Styleable h => Sides Length -> CSS h -> CSS h Source #

Element margin. Using gap and pad on parents is more intuitive and usually makes margin redundant

shadow :: (Styleable h, PropertyStyle Shadow a, ToClassName a) => a -> CSS h -> CSS h Source #

Add a drop shadow to an element

input ~ shadow Inner $ "Inset Shadow"
button ~ shadow () $ "Click Me"

data Shadow Source #

Instances

Instances details
PropertyStyle Shadow Inner Source # 
Instance details

Defined in Web.Atomic.CSS.Box

PropertyStyle Shadow None Source # 
Instance details

Defined in Web.Atomic.CSS.Box

PropertyStyle Shadow () Source # 
Instance details

Defined in Web.Atomic.CSS.Box

Methods

propertyStyle :: () -> Style Source #

data Inner Source #

Constructors

Inner 

Instances

Instances details
ToClassName Inner Source # 
Instance details

Defined in Web.Atomic.CSS.Box

Show Inner Source # 
Instance details

Defined in Web.Atomic.CSS.Box

Methods

showsPrec :: Int -> Inner -> ShowS #

show :: Inner -> String #

showList :: [Inner] -> ShowS #

PropertyStyle Shadow Inner Source # 
Instance details

Defined in Web.Atomic.CSS.Box

bg :: (ToColor clr, Styleable h) => clr -> CSS h -> CSS h Source #

Set the background color. See ToColor

rounded :: Styleable h => Length -> CSS h -> CSS h Source #

Round the corners of the element

border :: Styleable h => Sides PxRem -> CSS h -> CSS h Source #

Set a border around the element

el ~ border 1 $ "all sides"
el ~ border (X 1) $ "only left and right"

data BorderStyle Source #

Constructors

Solid 
Dashed 

Instances

Instances details
ToClassName BorderStyle Source # 
Instance details

Defined in Web.Atomic.CSS.Box

ToStyle BorderStyle Source # 
Instance details

Defined in Web.Atomic.CSS.Box

Show BorderStyle Source # 
Instance details

Defined in Web.Atomic.CSS.Box

borderColor :: (ToColor clr, Styleable h) => clr -> CSS h -> CSS h Source #

Set a border color. See ToColor

opacity :: Styleable h => Float -> CSS h -> CSS h Source #

sides :: (Styleable h, ToStyle a, ToClassName a, Num a) => ClassName -> (Property -> Property) -> Sides a -> CSS h -> CSS h Source #

utilities for every side with (Sides a)

sides' :: (Styleable h, ToStyle a, ToClassName a, Num a) => (a -> CSS h -> CSS h) -> (a -> CSS h -> CSS h) -> (a -> CSS h -> CSS h) -> (a -> CSS h -> CSS h) -> (a -> CSS h -> CSS h) -> Sides a -> CSS h -> CSS h Source #

case analysis for (Sides a)