Module

React.Stylesheet

Package
purescript-react-stylesheet
Repository
danieljharvey/purescript-react-stylesheet

Re-exports from React.Stylesheet.Internal.StyleContext

#createStyleContext Source

createStyleContext :: forall label. IsSymbol label => SProxy label -> StyleContext

Takes a CombinedReducer and a default state, and returns both a root-level provider and connect component for using the Radox store

Re-exports from React.Stylesheet.Internal.Types

#StyledWithChildren Source

type StyledWithChildren styleProps = CSSRuleSet styleProps -> styleProps -> Array Props -> Array ReactElement -> ReactElement

#StyledNoChildren Source

type StyledNoChildren styleProps = CSSRuleSet styleProps -> styleProps -> Array Props -> ReactElement

#StyledElements Source

type StyledElements = forall styleProps. { _data :: StyledWithChildren styleProps, a :: StyledWithChildren styleProps, abbr :: StyledWithChildren styleProps, address :: StyledWithChildren styleProps, article :: StyledWithChildren styleProps, aside :: StyledWithChildren styleProps, audio :: StyledWithChildren styleProps, b :: StyledWithChildren styleProps, bdi :: StyledWithChildren styleProps, bdo :: StyledWithChildren styleProps, big :: StyledWithChildren styleProps, blockquote :: StyledWithChildren styleProps, body :: StyledWithChildren styleProps, br :: StyledNoChildren styleProps, button :: StyledWithChildren styleProps, canvas :: StyledWithChildren styleProps, caption :: StyledWithChildren styleProps, cite :: StyledWithChildren styleProps, code :: StyledWithChildren styleProps, col :: StyledNoChildren styleProps, colgroup :: StyledWithChildren styleProps, datalist :: StyledWithChildren styleProps, dd :: StyledWithChildren styleProps, del :: StyledWithChildren styleProps, details :: StyledWithChildren styleProps, dfn :: StyledWithChildren styleProps, dialog :: StyledWithChildren styleProps, div :: StyledWithChildren styleProps, dl :: StyledWithChildren styleProps, dt :: StyledWithChildren styleProps, em :: StyledWithChildren styleProps, embed :: StyledNoChildren styleProps, fieldset :: StyledWithChildren styleProps, figcaption :: StyledWithChildren styleProps, figure :: StyledWithChildren styleProps, footer :: StyledWithChildren styleProps, form :: StyledWithChildren styleProps, h1 :: StyledWithChildren styleProps, h2 :: StyledWithChildren styleProps, h3 :: StyledWithChildren styleProps, h4 :: StyledWithChildren styleProps, h5 :: StyledWithChildren styleProps, h6 :: StyledWithChildren styleProps, head :: StyledWithChildren styleProps, header :: StyledWithChildren styleProps, hr :: StyledNoChildren styleProps, html :: StyledWithChildren styleProps, i :: StyledWithChildren styleProps, iframe :: StyledWithChildren styleProps, img :: StyledNoChildren styleProps, input :: StyledNoChildren styleProps, ins :: StyledWithChildren styleProps, kbd :: StyledWithChildren styleProps, keygen :: StyledNoChildren styleProps, label :: StyledWithChildren styleProps, legend :: StyledWithChildren styleProps, li :: StyledWithChildren styleProps, link :: StyledNoChildren styleProps, main :: StyledWithChildren styleProps, map :: StyledWithChildren styleProps, mark :: StyledWithChildren styleProps, menu :: StyledWithChildren styleProps, menuitem :: StyledNoChildren styleProps, meta :: StyledNoChildren styleProps, meter :: StyledWithChildren styleProps, nav :: StyledWithChildren styleProps, noscript :: StyledWithChildren styleProps, object :: StyledWithChildren styleProps, ol :: StyledWithChildren styleProps, optgroup :: StyledWithChildren styleProps, option :: StyledWithChildren styleProps, output :: StyledWithChildren styleProps, p :: StyledWithChildren styleProps, param :: StyledNoChildren styleProps, picture :: StyledWithChildren styleProps, pre :: StyledWithChildren styleProps, progress :: StyledWithChildren styleProps, q :: StyledWithChildren styleProps, rp :: StyledWithChildren styleProps, rt :: StyledWithChildren styleProps, ruby :: StyledWithChildren styleProps, s :: StyledWithChildren styleProps, samp :: StyledWithChildren styleProps, script :: StyledWithChildren styleProps, section :: StyledWithChildren styleProps, select :: StyledWithChildren styleProps, small :: StyledWithChildren styleProps, source :: StyledNoChildren styleProps, span :: StyledWithChildren styleProps, strong :: StyledWithChildren styleProps, style :: StyledWithChildren styleProps, sub :: StyledWithChildren styleProps, summary :: StyledWithChildren styleProps, sup :: StyledWithChildren styleProps, table :: StyledWithChildren styleProps, tbody :: StyledWithChildren styleProps, td :: StyledWithChildren styleProps, textarea :: StyledWithChildren styleProps, tfoot :: StyledWithChildren styleProps, th :: StyledWithChildren styleProps, thead :: StyledWithChildren styleProps, time :: StyledWithChildren styleProps, title :: StyledWithChildren styleProps, tr :: StyledWithChildren styleProps, track :: StyledNoChildren styleProps, u :: StyledWithChildren styleProps, ul :: StyledWithChildren styleProps, var :: StyledWithChildren styleProps, video :: StyledWithChildren styleProps, wbr :: StyledNoChildren styleProps }

#StyleRenderMethod Source

type StyleRenderMethod props localState = { classNames :: Array CSSSelector, localState :: localState, props :: props } -> ReactElement

#StyleProvider Source

#StyleContext Source

type StyleContext = { consumer :: StyleConsumer, elements :: StyledElements, provider :: StyleProvider }

#StyleConsumer Source

type StyleConsumer = forall localState props. props -> localState -> CSSRuleSet props -> StyleRenderMethod props localState -> ReactElement

Re-exports from Stylesheet

#UnpackedRule Source

type UnpackedRule a = { id :: Int, item :: a, ruleText :: CSSText, selector :: CSSSelector }

#UnpackedMediaRule Source

type UnpackedMediaRule a = { id :: Int, item :: a, query :: MediaQueryText }

#StylesheetId Source

newtype StylesheetId

Unique ID for stylesheet in DOM

Constructors

#Stylesheet Source

#InsertRule Source

data InsertRule

Data structure used internally to describe a single CSS rule

Constructors

Instances

#InsertMediaRule Source

data InsertMediaRule

A complete single rule or nested media rule

Constructors

#CSSSelector Source

data CSSSelector

CSS Selectors used in DOM, currently we only use class selectors

Constructors

Instances

#CSSRuleSet Source

newtype CSSRuleSet p

CSSRuleSet is what we build up for a style

Constructors

Instances

#unpackRule Source

unpackRule :: IndexedRule CSSStyleRule -> Effect (UnpackedRule CSSStyleRule)

This takes an item and returns the selector and declaration text Useful for diffing etc

#str Source

str :: forall props. String -> CSSRuleSet props

Create a rule that takes no props

#readVirtualStylesheet Source

#processStyle Source

processStyle :: forall props. CSSRuleSet props -> props -> StyleRuleSet

#media Source

media :: forall props. String -> CSSRuleSet props -> CSSRuleSet props

Create a media query

#keep Source

keep :: StyleRuleSet -> Array InsertMediaRule

This commits the rendered StyleRuleSet into InsertMediaRules that we can store and apply to the CSSOM

#insertRule Source

insertRule :: forall a. HasRuleList a => a -> InsertRule -> Effect Unit

Insert new rule into stylesheet, deleting old one if name matches

#insertRecursive Source

#getUnpackedStyleRules Source

getUnpackedStyleRules :: CSSRuleList -> Effect (Array (UnpackedRule CSSStyleRule))

Gets style rules for a rule list and fetches basic data about them

#getStylesheetId Source

#getStyleRuleSelectorText Source

getStyleRuleSelectorText :: CSSStyleRule -> Effect CSSSelector

Get the selector text of a CSSStyleRule

#getStyleRuleDeclarationText Source

getStyleRuleDeclarationText :: CSSStyleRule -> Effect CSSText

Get the Style Declaration of a CSSStyleRule

#getMediaRuleMediaText Source

getMediaRuleMediaText :: CSSMediaRule -> Effect MediaQueryText

Get the rule from the Media Rule

#getFilteredRuleList Source

getFilteredRuleList :: CSSRuleList -> Effect CSSRules

Get all the rules of a stylesheet, split by type

#getClasses Source

getClasses :: InsertMediaRule -> Array CSSSelector

Get the generated CSS classes from the CSS. These are generated from hashes of the content

#getCSSStylesheet Source

#fun Source

fun :: forall props. (props -> String) -> CSSRuleSet props

Create a rule that receives the props

#createHashedInsertRule Source

createHashedInsertRule :: CSSText -> InsertRule

This creates a unique hash of the CSS that we'll use to make the classname

#createBlankStylesheet Source

createBlankStylesheet :: forall p. IsSymbol p => Effect (Stylesheet p)

Create a StyleSheet in the DOM along with an empty VirtualStylesheet to record it's contents

#addStyle Source

addStyle :: forall props p. Stylesheet p -> CSSRuleSet props -> props -> Effect (Array CSSSelector)

This is the top level big dog of a function, as such We provide the big Stylesheet doing-things-lump a function from props -> Styles some props and we get back a bunch of CSSSelectors (classes)