miso
Copyright(C) 2016-2025 David M. Johnson
LicenseBSD3-style (see the file LICENSE)
MaintainerDavid M. Johnson <code@dmj.io>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Miso.Style

Description

 
Synopsis

Types

type Style = (MisoString, MisoString) Source #

Style

Type for a CSS Style

type Styles = Map MisoString MisoString Source #

Styles

Type for a Map of CSS Style. Used with StyleSheet.

data StyleSheet Source #

StyleSheet

Type for a CSS style on native

Smart Constructor

style_ :: [Style] -> Attribute action Source #

style_ is an attribute that will set the style attribute of the associated DOM node to attrs.

style attributes not contained in attrs will be deleted.

import qualified Data.Map as M
div_ [ style_ [ backgroundColor "red" ] [ ]

https://developer.mozilla.org/en-US/docs/Web/CSS

styleInline_ :: MisoString -> Attribute action Source #

Set "style" property

view m = div_ [ styleInline_ "background-color:red;color:blue;" ] [ "foo" ]

https://developer.mozilla.org/en-US/docs/Web/CSS

(=:) :: k -> v -> (k, v) Source #

Smart constructor for Attributes. This function is helpful when constructing Style.

Example shown below.

div_ [ style_  [ "background" =: "red" ] ] []

Render

Combinators

Colors

hsl :: Int -> Int -> Int -> Color Source #

rgba :: Int -> Int -> Int -> Int -> Color Source #

data Color Source #

Instances

Instances details
Show Color Source # 
Instance details

Defined in Miso.Style.Color

Methods

showsPrec :: Int -> Color -> ShowS #

show :: Color -> String #

showList :: [Color] -> ShowS #

Eq Color Source # 
Instance details

Defined in Miso.Style.Color

Methods

(==) :: Color -> Color -> Bool #

(/=) :: Color -> Color -> Bool #