Module
PureStyle
- Package
- purescript-pure-style
- Repository
- oreshinya/purescript-pure-style
#StyleSheet Source
newtype StyleSheetThe type of stylesheet.
#createStyleSheet Source
createStyleSheet :: StyleSheetCreate a stylesheet.
#getStyle Source
getStyle :: StyleSheet -> StringGet all styles in a stylesheet.
#registerStyle Source
registerStyle :: StyleSheet -> String -> StringDefine styles with css string.
This generate a hash from css string, and replace & with its hash in css string, finally return its hash string.
So, returned string can be used as class name.
sheet :: StyleSheet
sheet = createStyleSheet
sampleClass :: String
sampleClass = registerStyle sheet
"""
.& {
width: 100px;
height: 100px;
}
.&:hover {
width: 100px;
height: 100px;
}
.&:hover .selected {
color: blue;
}
"""
Added styles to stylesheet like:
.pz66dqm {
width: 100px;
height: 100px;
}
.pz66dqm:hover {
width: 100px;
height: 100px;
}
.pz66dqm:hover .selected {
color: blue;
}
- Modules
- PureStyle