Global

Methods

animation(value) → {object}

Source:

Shorthand animation helper

Examples
// A single property
animation({name: 'foo'});
// → {
//     animationName: 'foo'
//   }
// Multiple properties
animation({name: 'foo', duration: 'bar'});
// → {
//     animationName: 'foo',
//     animationDuration: 'bar'
//   }
Parameters:
Name Type Description
value object
Properties
Name Type Attributes Description
name number | string <optional>

animation name value

duration number | string <optional>

animation duration value

timingFunction number | string <optional>

animation timingFunction value

delay number | string <optional>

animation delay value

iterationCount number | string <optional>

animation iterationCount value

direction number | string <optional>

animation direction value

fillMode number | string <optional>

animation fillMode value

playState number | string <optional>

animation playState value

Returns:

Style object

Type
object

background(value) → {object}

Source:

Shorthand background helper

Examples
// A single property
background({image: 'foo'});
// → {
//     backgroundImage: 'foo'
//   }
// Multiple properties
background({image: 'foo', position: 'bar'});
// → {
//     backgroundImage: 'foo',
//     backgroundPosition: 'bar'
//   }
Parameters:
Name Type Description
value object
Properties
Name Type Attributes Description
image number | string <optional>

background image value

position number | string <optional>

background position value

size number | string <optional>

background size value

repeat number | string <optional>

background repeat value

origin number | string <optional>

background origin value

clip number | string <optional>

background clip value

attachment number | string <optional>

background attachment value

color number | string <optional>

background color value

Returns:

Style object

Type
object

border(value) → {object}

Source:

Shorthand border helper

Examples
// A single property in all directions
border({color: 'red'});
// → {
//     borderTopColor: 'red',
//     borderRightColor: 'red',
//     borderBottomColor: 'red',
//     borderLeftColor: 'red'
//   }
// Any combination
border({color: 'red', width: {y: '2px', right: '8px'}});
// → {
//     borderTopColor: 'red',
//     borderRightColor: 'red',
//     borderBottomColor: 'red',
//     borderLeftColor: 'red',
//     borderTopWidth: '2px',
//     borderRightWidth: '8px',
//     borderBottomWidth: '2px'
//   }
Parameters:
Name Type Description
value object
Properties
Name Type Attributes Description
color number | string | object <optional>

border color value (see borderColor)

style number | string | object <optional>

border style value (see borderStyle)

width number | string | object <optional>

border width value (see borderWidth)

radius number | string | object <optional>

border radius value (see borderRadius)

Returns:

Style object

Type
object

borderColor(value) → {object}

Source:

Directional borderColor helper

Examples
// All directions
borderColor('foo');
// → {
//     borderTopColor: 'foo',
//     borderRightColor: 'foo',
//     borderBottomColor: 'foo',
//     borderLeftColor: 'foo'
//   }
// A single axis
borderColor({x: 'bar'});
// → {
//     borderLeftColor: 'bar',
//     borderRightColor: 'bar'
//   }
// Any combination
borderColor({y: 'foo', top: 'bar', right: 'baz'});
// → {
//     borderTopColor: 'bar',
//     borderRightColor: 'baz',
//     borderBottomColor: 'foo'
//   }
Parameters:
Name Type Description
value number | string | object

Value for all directions or object of values:

Properties
Name Type Attributes Description
x number | string <optional>

Left and right value

y number | string <optional>

Top and bottom value

top number | string <optional>

Top value (takes precedence over y)

right number | string <optional>

Right value (takes precedence over x)

bottom number | string <optional>

Bottom value (takes precedence over y)

left number | string <optional>

Left value (takes precedence over x)

Returns:

Style object

Type
object

borderImage(value) → {object}

Source:

Shorthand borderImage helper

Examples
// A single property
borderImage({source: 'foo'});
// → {
//     borderImageSource: 'foo'
//   }
// Multiple properties
borderImage({source: 'foo', slice: 'bar'});
// → {
//     borderImageSource: 'foo',
//     borderImageSlice: 'bar'
//   }
Parameters:
Name Type Description
value object
Properties
Name Type Attributes Description
source number | string <optional>

borderImage source value

slice number | string <optional>

borderImage slice value

width number | string <optional>

borderImage width value

outset number | string <optional>

borderImage outset value

repeat number | string <optional>

borderImage repeat value

Returns:

Style object

Type
object

borderRadius(value) → {object}

Source:

Directional borderRadius helper

Examples
// All directions
borderRadius('foo');
// → {
//     borderTopRadius: 'foo',
//     borderRightRadius: 'foo',
//     borderBottomRadius: 'foo',
//     borderLeftRadius: 'foo'
//   }
// A single axis
borderRadius({x: 'bar'});
// → {
//     borderLeftRadius: 'bar',
//     borderRightRadius: 'bar'
//   }
// Any combination
borderRadius({y: 'foo', top: 'bar', right: 'baz'});
// → {
//     borderTopRadius: 'bar',
//     borderRightRadius: 'baz',
//     borderBottomRadius: 'foo'
//   }
Parameters:
Name Type Description
value number | string | object

Value for all directions or object of values:

Properties
Name Type Attributes Description
x number | string <optional>

Left and right value

y number | string <optional>

Top and bottom value

top number | string <optional>

Top value (takes precedence over y)

right number | string <optional>

Right value (takes precedence over x)

bottom number | string <optional>

Bottom value (takes precedence over y)

left number | string <optional>

Left value (takes precedence over x)

Returns:

Style object

Type
object

borderStyle(value) → {object}

Source:

Directional borderStyle helper

Examples
// All directions
borderStyle('foo');
// → {
//     borderTopStyle: 'foo',
//     borderRightStyle: 'foo',
//     borderBottomStyle: 'foo',
//     borderLeftStyle: 'foo'
//   }
// A single axis
borderStyle({x: 'bar'});
// → {
//     borderLeftStyle: 'bar',
//     borderRightStyle: 'bar'
//   }
// Any combination
borderStyle({y: 'foo', top: 'bar', right: 'baz'});
// → {
//     borderTopStyle: 'bar',
//     borderRightStyle: 'baz',
//     borderBottomStyle: 'foo'
//   }
Parameters:
Name Type Description
value number | string | object

Value for all directions or object of values:

Properties
Name Type Attributes Description
x number | string <optional>

Left and right value

y number | string <optional>

Top and bottom value

top number | string <optional>

Top value (takes precedence over y)

right number | string <optional>

Right value (takes precedence over x)

bottom number | string <optional>

Bottom value (takes precedence over y)

left number | string <optional>

Left value (takes precedence over x)

Returns:

Style object

Type
object

borderWidth(value) → {object}

Source:

Directional borderWidth helper

Examples
// All directions
borderWidth('foo');
// → {
//     borderTopWidth: 'foo',
//     borderRightWidth: 'foo',
//     borderBottomWidth: 'foo',
//     borderLeftWidth: 'foo'
//   }
// A single axis
borderWidth({x: 'bar'});
// → {
//     borderLeftWidth: 'bar',
//     borderRightWidth: 'bar'
//   }
// Any combination
borderWidth({y: 'foo', top: 'bar', right: 'baz'});
// → {
//     borderTopWidth: 'bar',
//     borderRightWidth: 'baz',
//     borderBottomWidth: 'foo'
//   }
Parameters:
Name Type Description
value number | string | object

Value for all directions or object of values:

Properties
Name Type Attributes Description
x number | string <optional>

Left and right value

y number | string <optional>

Top and bottom value

top number | string <optional>

Top value (takes precedence over y)

right number | string <optional>

Right value (takes precedence over x)

bottom number | string <optional>

Bottom value (takes precedence over y)

left number | string <optional>

Left value (takes precedence over x)

Returns:

Style object

Type
object

flex(value) → {object}

Source:

Shorthand flex helper

Examples
// A single property
flex({grow: 'foo'});
// → {
//     flexGrow: 'foo'
//   }
// Multiple properties
flex({grow: 'foo', shrink: 'bar'});
// → {
//     flexGrow: 'foo',
//     flexShrink: 'bar'
//   }
Parameters:
Name Type Description
value object
Properties
Name Type Attributes Description
grow number | string <optional>

flex grow value

shrink number | string <optional>

flex shrink value

basis number | string <optional>

flex basis value

Returns:

Style object

Type
object

font(value) → {object}

Source:

Shorthand font helper

Examples
// A single property
font({style: 'foo'});
// → {
//     fontStyle: 'foo'
//   }
// Multiple properties
font({style: 'foo', variant: 'bar'});
// → {
//     fontStyle: 'foo',
//     fontVariant: 'bar'
//   }
Parameters:
Name Type Description
value object
Properties
Name Type Attributes Description
style number | string <optional>

font style value

variant number | string <optional>

font variant value

weight number | string <optional>

font weight value

stretch number | string <optional>

font stretch value

size number | string <optional>

font size value

family number | string <optional>

font family value

Returns:

Style object

Type
object

listStyle(value) → {object}

Source:

Shorthand listStyle helper

Examples
// A single property
listStyle({type: 'foo'});
// → {
//     listStyleType: 'foo'
//   }
// Multiple properties
listStyle({type: 'foo', position: 'bar'});
// → {
//     listStyleType: 'foo',
//     listStylePosition: 'bar'
//   }
Parameters:
Name Type Description
value object
Properties
Name Type Attributes Description
type number | string <optional>

listStyle type value

position number | string <optional>

listStyle position value

image number | string <optional>

listStyle image value

Returns:

Style object

Type
object

margin(value) → {object}

Source:

Directional margin helper

Examples
// All directions
margin('foo');
// → {
//     marginTop: 'foo',
//     marginRight: 'foo',
//     marginBottom: 'foo',
//     marginLeft: 'foo'
//   }
// A single axis
margin({x: 'bar'});
// → {
//     marginLeft: 'bar',
//     marginRight: 'bar'
//   }
// Any combination
margin({y: 'foo', top: 'bar', right: 'baz'});
// → {
//     marginTop: 'bar',
//     marginRight: 'baz',
//     marginBottom: 'foo'
//   }
Parameters:
Name Type Description
value number | string | object

Value for all directions or object of values:

Properties
Name Type Attributes Description
x number | string <optional>

Left and right value

y number | string <optional>

Top and bottom value

top number | string <optional>

Top value (takes precedence over y)

right number | string <optional>

Right value (takes precedence over x)

bottom number | string <optional>

Bottom value (takes precedence over y)

left number | string <optional>

Left value (takes precedence over x)

Returns:

Style object

Type
object

outline(value) → {object}

Source:

Shorthand outline helper

Examples
// A single property
outline({width: 'foo'});
// → {
//     outlineWidth: 'foo'
//   }
// Multiple properties
outline({width: 'foo', style: 'bar'});
// → {
//     outlineWidth: 'foo',
//     outlineStyle: 'bar'
//   }
Parameters:
Name Type Description
value object
Properties
Name Type Attributes Description
width number | string <optional>

outline width value

style number | string <optional>

outline style value

color number | string <optional>

outline color value

Returns:

Style object

Type
object

padding(value) → {object}

Source:

Directional padding helper

Examples
// All directions
padding('foo');
// → {
//     paddingTop: 'foo',
//     paddingRight: 'foo',
//     paddingBottom: 'foo',
//     paddingLeft: 'foo'
//   }
// A single axis
padding({x: 'bar'});
// → {
//     paddingLeft: 'bar',
//     paddingRight: 'bar'
//   }
// Any combination
padding({y: 'foo', top: 'bar', right: 'baz'});
// → {
//     paddingTop: 'bar',
//     paddingRight: 'baz',
//     paddingBottom: 'foo'
//   }
Parameters:
Name Type Description
value number | string | object

Value for all directions or object of values:

Properties
Name Type Attributes Description
x number | string <optional>

Left and right value

y number | string <optional>

Top and bottom value

top number | string <optional>

Top value (takes precedence over y)

right number | string <optional>

Right value (takes precedence over x)

bottom number | string <optional>

Bottom value (takes precedence over y)

left number | string <optional>

Left value (takes precedence over x)

Returns:

Style object

Type
object

transition(value) → {object}

Source:

Shorthand transition helper

Examples
// A single property
transition({property: 'foo'});
// → {
//     transitionProperty: 'foo'
//   }
// Multiple properties
transition({property: 'foo', duration: 'bar'});
// → {
//     transitionProperty: 'foo',
//     transitionDuration: 'bar'
//   }
Parameters:
Name Type Description
value object
Properties
Name Type Attributes Description
property number | string <optional>

transition property value

duration number | string <optional>

transition duration value

timingFunction number | string <optional>

transition timingFunction value

delay number | string <optional>

transition delay value

Returns:

Style object

Type
object