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
type StyleProvider = ReactClass { children :: Array ReactElement }
#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
#VirtualStylesheet Source
#UnpackedRule Source
type UnpackedRule a = { id :: Int, item :: a, ruleText :: CSSText, selector :: CSSSelector }
#UnpackedMediaRule Source
type UnpackedMediaRule a = { id :: Int, item :: a, query :: MediaQueryText }
#StyleRuleSet Source
#MediaQueryText Source
#InsertRule Source
#InsertMediaRule Source
#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
CSSRuleSet (Array (CSSRule p))
Instances
Semigroup (CSSRuleSet p)
Monoid (CSSRuleSet p)
#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
readVirtualStylesheet :: forall p. Stylesheet p -> Effect (VirtualStylesheet p)
#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
insertRecursive :: forall a. HasRuleList a => a -> InsertMediaRule -> Effect Unit
#getUnpackedStyleRules Source
getUnpackedStyleRules :: CSSRuleList -> Effect (Array (UnpackedRule CSSStyleRule))
Gets style rules for a rule list and fetches basic data about them
#getStylesheetId Source
getStylesheetId :: forall s. IsSymbol s => VirtualStylesheet s -> StylesheetId
#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
getCSSStylesheet :: forall p. Stylesheet p -> CSSStyleSheet
#fun Source
fun :: forall props. (props -> String) -> CSSRuleSet props
Create a rule that receives the props
#findRuleBySelector Source
findRuleBySelector :: CSSRuleList -> CSSSelector -> Effect (Maybe (UnpackedRule CSSStyleRule))
#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
#createAndReturnCSSMediaRule Source
createAndReturnCSSMediaRule :: forall a. HasRuleList a => a -> MediaQueryText -> Effect (Maybe (UnpackedMediaRule CSSMediaRule))
#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)