Methods
(static) makeStyle(object) → {string}
- Source:
- Since:
- 0.1.0
Return a style string from an object
Example
> makeStyle({color: 'red', 'font-size': '10px'})
'color:red;font-size:10px'
Parameters:
Name | Type | Description |
---|---|---|
object |
object |
Returns:
styleString
- Type
- string
(static) makeStyleVars(object) → {string}
- Source:
- Since:
- 0.4.0
Return a style string with hyphenate CSS variables derived from the keys of the expected object
Example
> makeStyleVars({foo: 'red', 'bar': '10px'})
'--foo:red;--bar:10px'
Parameters:
Name | Type | Description |
---|---|---|
object |
object |
Returns:
styleString
- Type
- string
(static) toPx(number) → {string}
- Source:
- Since:
- 0.1.0
Return a px representation of the received number. Throws an error if the input is not a number.
Example
> toPx(10)
'10px'
Parameters:
Name | Type | Description |
---|---|---|
number |
number |
Returns:
- Type
- string