StyleJack

class StyleJack(context)
Arguments:
  • context (HTMLElement/String) –
    Either a HTMLElement or a string containing a style rule (ex. “div.class” or HTMLDivElement) StyleJack also supports @font-face rules and @keyframes. These return their own APIs instead of StyleJack API.
    returns:StyleJackAPI() or StyleJackFontFaceAPI() or StyleJackCSSKeyFrameAPI()

StyleJack API

StyleJack API is simply a representation of the Object that you are returned after initializing a new StyleJack with a Node/StyleRule

You cannot instantiate this manually, as it’s the return value from StyleJack

StyleJack is a fairly fluid API. For most contexts, if you are setting a value, you will receive the relevant API back. This means that if you’re on the level 1 API (StyleJackAPI), you will receive the StyleJack API back to allow chaining. If you are on a level 2 API (StyleJackBackgroundAPI), you will receive that API back. The property .api will allow you to return to the level 1 API

Note

The String “$” Is a special value that you can pass into all of the StyleJackAPI methods to get the raw value back. Else, StyleJack will attempt to parse the value from px to a programatically usable value (eg: String(“16px”) => Number(16). If the value is in any other format (eg: em, pt, cm) it will be returned as a String.

This is convenient in the cases where the Style returns a Level 2 API (ex: Background), as you can simply call:

KUBE.Class('/Library/DOM/StyleJack')(document.body).Background('$');

instead of:

KUBE.Class('/Library/DOM/StyleJack')(document.body).Background().Get();
class StyleJackAPI()
StyleJackAPI.Delete()

Deletes the current style rule from the stylesheet.

Returns:void
StyleJackAPI.GetStyleObj()

Returns the CSSStyleRule that this current StyleJack represents

Returns:CSSStyleRule()
StyleJackAPI.Appearance([_value])

Used for getting/setting the appearance property.

returns:StyleJackAPI()

Todo

Appearance property has some flaws. It’s prefixed everywhere, and the values are prefixed as well We might need to re-assess it and possibly remove it from StyleJack for the time being.

StyleJackAPI.BackfaceVisibility([_value])
Arguments:
  • _value (String) –
    If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
    returns:StyleJackAPI()
StyleJackAPI.Background([_value])
Arguments:
  • _value (String) – If no value passed in, returns StyleJackBackgroundAPI. Any value other than “$” attempts to set the passed value to the property “$” as a value returns the raw value of the property
Returns:

StyleJackBackgroundAPI()

StyleJackAPI.Border([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBorderAPI()

StyleJackAPI.Bottom([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Box([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxAPI()

StyleJackAPI.CaptionSide([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Clear([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Clip([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Color([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Content([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Cursor([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Direction([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Display([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.EmptyCells([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Float([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Font([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Height([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Left([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.LetterSpacing([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.LineHeight([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Margin([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.MinHeight([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.MinWidth([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.MaxHeight([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.MaxWidth([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Opacity([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Outline([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Overflow([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Padding([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Position([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Resize([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Right([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.TableLayout([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Text([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Top([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Transform([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Transition([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.VerticalAlign([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Visibility([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.Width([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI() Or Number

StyleJackAPI.WhiteSpace([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.WordSpacing([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.WordBreak([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.WordWrap([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJackAPI.ZIndex([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackAPI()

StyleJack Background API

class StyleJackBackgroundAPI()
StyleJackBackgroundAPI.Set([_value])
Arguments:
  • _value (String) – Equivalent to calling Set on the level 1 API. Only difference is that ‘$’ is not a valid input value, as set will always return StyleJackBackground()
Returns:

StyleJackBackgroundAPI()

StyleJackBackgroundAPI.Get()

The object that’s returned has both numerical and string keys. The object returned looks like:

{
    0:color,1:position,2:size,3:repeat,4:origin,5:clip,6:attachment,7:image,
    'color':color, 'position':position, 'size':size, 'repeat':repeat,
    'origin':origin,'clip':clip, 'attachment':attachment, 'image':image
};
Returns:Object
StyleJackBackgroundAPI.Color([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBackgroundAPI()

StyleJackBackgroundAPI.Attachment()
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBackgroundAPI()

StyleJackBackgroundAPI.Image()
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBackgroundAPI()

StyleJackBackgroundAPI.Position()
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBackgroundAPI()

StyleJackBackgroundAPI.Repeat()
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBackgroundAPI()

StyleJackBackgroundAPI.Clip()
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBackgroundAPI()

StyleJackBackgroundAPI.Origin()
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBackgroundAPI()

StyleJackBackgroundAPI.Size()
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBackgroundAPI()

StyleJackBackgroundAPI.api
Returns:StyleJackAPI()

StyleJack Border API

class StyleJackBorderAPI()
StyleJackBorderAPI.Get()

The object that’s returned has both numerical and string keys.

{ 0:width, 1:style, 2:color, 'width':width, 'style':style, 'color':color,'length':3 };
Returns:Object
StyleJackBorderAPI.Set([_value])
Arguments:
  • _value (String/Object/Array) –

    Any value attempts to set the passed value to the property.

    Note

    _value can be in the form of an object, with the keys “width”,”style” and “color”. It can be also in an array, with index 0 being width, index 1 being style and index 2 being color

Returns:

StyleJackBorderAPI()

StyleJackBorderAPI.Top([_value])
Arguments:
  • _value (String/Object/Array) –

    If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property.

    Note

    _value can be in the form of an object, with the keys “width”,”style” and “color”. It can be also in an array, with index 0 being width, index 1 being style and index 2 being color

Returns:

StyleJackBorderAPI()

StyleJackBorderAPI.Right([_value])
Arguments:
  • _value (String/Object/Array) –

    If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property.

    Note

    _value can be in the form of an object, with the keys “width”,”style” and “color”. It can be also in an array, with index 0 being width, index 1 being style and index 2 being color

Returns:

StyleJackBorderAPI()

StyleJackBorderAPI.Bottom([_value])
Arguments:
  • _value (String/Object/Array) –

    If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property.

    Note

    _value can be in the form of an object, with the keys “width”,”style” and “color”. It can be also in an array, with index 0 being width, index 1 being style and index 2 being color

Returns:

StyleJackBorderAPI()

StyleJackBorderAPI.Left([_value])
Arguments:
  • _value (String/Object/Array) –

    If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property.

    Note

    _value can be in the form of an object, with the keys “width”,”style” and “color”. It can be also in an array, with index 0 being width, index 1 being style and index 2 being color

Returns:

StyleJackBorderAPI()

StyleJackBorderAPI.Radius()

Returns the Border Radius API for manipulating the Border Radius property

Returns:StyleJackBorderRadiusAPI()

StyleJack Border Radius API

class StyleJackBorderRadiusAPI()
StyleJackBorderRadiusAPI.Set([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBorderRadiusAPI()

StyleJackBorderRadiusAPI.Get()

The object that’s returned has both numerical and string keys.

{
    0:topLeft, 1:topRight, 2:bottomRight, 3:bottomLeft,
    'topLeft':topLeft, 'topRight':topRight, 'bottomRight':bottomRight,
    'bottomLeft':bottomLeft
}
Returns:Object
StyleJackBorderRadiusAPI.TopLeft([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBorderRadiusAPI()

StyleJackBorderRadiusAPI.TopRight([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBorderRadiusAPI()

StyleJackBorderRadiusAPI.BottomRight([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBorderRadiusAPI()

StyleJackBorderRadiusAPI.BottomLeft([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBorderRadiusAPI()

StyleJackBorderRadiusAPI.api
Returns:StyleJackAPI()

StyleJack Box API

class StyleJackBoxAPI()
StyleJackBoxAPI.Align([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxAPI()

StyleJackBoxAPI.Direction([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxAPI()

StyleJackBoxAPI.Flex([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxAPI()

StyleJackBoxAPI.FlexGroup([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxAPI()

StyleJackBoxAPI.Lines([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxAPI()

StyleJackBoxAPI.OrdinalGroup([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxAPI()

StyleJackBoxAPI.Orient([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxAPI()

StyleJackBoxAPI.Pack([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxAPI()

StyleJackBoxAPI.Sizing([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxAPI()

StyleJackBoxAPI.Shadow([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxShadowAPI()

StyleJackBoxAPI.api
Returns:StyleJackAPI()

StyleJack Box Shadow API

class StyleJackBoxShadowAPI()
StyleJackBoxShadowAPI.Get()

The object that’s returned has both numerical and string keys.

{
    'horizontal':horizontal, 'vertical':vertical, 'blur':blur,
    'color':color,'inset': inset
}
Returns:Object
StyleJackBoxShadowAPI.Set([_value])

Any value attempts to set the passed value to the property.

Note

_value can be in the form of an object, with the keys “width”,”style” and “color”. It can be also in an array, with index 0 being width, index 1 being style and index 2 being color

StyleJackBoxShadowAPI.Horizontal([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxShadowAPI()

StyleJackBoxShadowAPI.Vertical([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxShadowAPI()

StyleJackBoxShadowAPI.H([_value])
Arguments:
  • _value (String) –

    If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property

    An alias for Horizontal

Returns:

StyleJackBoxShadowAPI()

StyleJackBoxShadowAPI.V([_value])
Arguments:
  • _value (String) –

    If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property

    An alias for Vertical

Returns:

StyleJackBoxShadowAPI()

StyleJackBoxShadowAPI.Blur([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxShadowAPI()

StyleJackBoxShadowAPI.Spread([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxShadowAPI()

StyleJackBoxShadowAPI.Color([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxShadowAPI()

StyleJackBoxShadowAPI.Inset([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackBoxShadowAPI()

StyleJackBoxShadowAPI.api
Returns:StyleJackAPI()

StyleJack Font API

class StyleJackFontAPI()
StyleJackFontAPI.Get([asArray])

If passed a truthy value, it will return an array with the order of Style, Variant, Weight, Size, Family. else, it’ll simply return the string that the font property represents.

Returns:Array/String
StyleJackFontAPI.Set([_value])

Any value attempts to set the passed value to the property.

Note

_value can be a string, which will attempt to set the font property directly.

It may also be a 5 element array in the order of Style, Variant, Weight, Size and Family, which will automatically set the various font properties.

Returns:StyleJackFontAPI()
StyleJackFontAPI.Family([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackFontAPI()

StyleJackFontAPI.Size([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackFontAPI()

StyleJackFontAPI.Style([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackFontAPI()

StyleJackFontAPI.Variant([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackFontAPI()

StyleJackFontAPI.Weight([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackFontAPI()

StyleJackFontAPI.api
Returns:StyleJackAPI()

StyleJack Margin API

class StyleJackMarginAPI()
StyleJackMarginAPI.Get()
Returns:Object
StyleJackMarginAPI.Set([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property

Note

You can also pass in an array or object as a value. The format for an object simply has “top”,”right”,”bottom”,”left” keys which then sets the according value for that key. Keys may be omitted. If you use an array, it can be any length between 1 and 4.

This follows normal CSS behaviour. Where a 1 length array sets all sides to the same value. 2 length array sets top and bottom to same value and left and right to same value.

Returns:StyleJackMarginAPI()
StyleJackMarginAPI.Top([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackMarginAPI()

StyleJackMarginAPI.Right([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackMarginAPI()

StyleJackMarginAPI.Bottom([_value])
Arguments:
  • _value (String) –

    If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property

    returns:StyleJackMarginAPI()
StyleJackMarginAPI.Left([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackMarginAPI()

StyleJackMarginAPI.Center()
Automatically sets margin left and right to “auto”.
Returns:StyleJackMarginAPI()
StyleJackMarginAPI.api
Returns:StyleJackAPI()

StyleJack Outline API

class StyleJackOutlineAPI()
StyleJackOutlineAPI.Width([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackMarginAPI()

StyleJackOutlineAPI.Style([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackMarginAPI()

StyleJackOutlineAPI.Color([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackMarginAPI()

StyleJackOutlineAPI.Offset([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackMarginAPI()

StyleJackOutlineAPI.api
Returns:StyleJackAPI()

StyleJack OverFlow API

class StyleJackOverflowAPI()
StyleJackOverflowAPI.Get()

Returns a 2 index array containing the X and Y value of the overflow property

Returns:array
StyleJackOverflowAPI.Set(_value)
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackOverflowAPI()

StyleJackOverflowAPI.X(_value)
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackOverflowAPI()

StyleJackOverflowAPI.Y(_value)
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackOverflowAPI()

StyleJackOverflowAPI.api
Returns:StyleJackAPI()

StyleJack Padding API

class StyleJackPaddingAPI()
StyleJackPaddingAPI.Get()
Returns:Object
StyleJackPaddingAPI.Set([_value])
Arguments:
  • _value (String) –
    If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property

    Note

    You can also pass in an array or object as a value. The format for an object simply has “top”,”right”,”bottom”,”left” keys which then sets the according value for that key. Keys may be omitted. If you use an array, it can be any length between 1 and 4.

    This follows normal CSS behaviour. Where a 1 length array sets all sides to the same value. 2 length array sets top and bottom to same value and left and right to same value.

Returns:

StyleJackPaddingAPI()

StyleJackPaddingAPI.Top([_value])
Arguments:
  • _value (String) –
    If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
    returns:StyleJackPaddingAPI()
StyleJackPaddingAPI.Right([_value])
Arguments:
  • _value (String) –
    If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
    returns:StyleJackPaddingAPI()
StyleJackPaddingAPI.Bottom([_value])
Arguments:
  • _value (String) –

    If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property

    returns:StyleJackPaddingAPI()
StyleJackPaddingAPI.Left([_value])
Arguments:
  • _value (String) –
    If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
    returns:StyleJackPaddingAPI()
StyleJackPaddingAPI.Center()
Automatically sets margin left and right to “auto”.
Returns:StyleJackPaddingAPI()
StyleJackPaddingAPI.api
Returns:StyleJackAPI()

StyleJack Text API

class StyleJackTextAPI()
StyleJackTextAPI.Align([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackTextAPI()

StyleJackTextAPI.Decoration([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackTextAPI()

StyleJackTextAPI.Indent([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackTextAPI()

StyleJackTextAPI.Overflow([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackTextAPI()

StyleJackTextAPI.Shadow([_value])
Returns:StyleJackTextAPI()
StyleJackTextAPI.Transform([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackTextAPI()

StyleJackTextAPI.api
Returns:StyleJackAPI()

StyleJack Text Shadow API

class StyleJackTextShadowAPI()
StyleJackTextShadowAPI.Get()

The object that’s returned contains the following string keys.

{
    'horizontal':horizontal, 'vertical':vertical, 'blur':blur,
    'color':color
}
Returns:Object
StyleJackTextShadowAPI.Set([_value])

Any value attempts to set the passed value to the property.

Note

_value can be in the form of an object, with the keys “width”,”style” and “color”. It can be also in an array, with index 0 being width, index 1 being style and index 2 being color

StyleJackTextShadowAPI.Horizontal([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackTextShadowAPI()

StyleJackTextShadowAPI.Vertical([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackTextShadowAPI()

StyleJackTextShadowAPI.H([_value])
Arguments:
  • _value (String) –

    If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property

    An alias for Horizontal

Returns:

StyleJackTextShadowAPI()

StyleJackTextShadowAPI.V([_value])
Arguments:
  • _value (String) –

    If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property

    An alias for Vertical

Returns:

StyleJackTextShadowAPI()

StyleJackTextShadowAPI.Blur([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackTextShadowAPI()

StyleJackTextShadowAPI.Color([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackTextShadowAPI()

StyleJackTextShadowAPI.api
Returns:StyleJackAPI()

StyleJack Transform API

Supports 2D transforms currently.
class StyleJackTransformAPI()
StyleJackTransformAPI.Matrix([_value])
Arguments:
  • _value (Array/String) – If no value or “$” passed in, returns the current value (as an array). To set, you must pass in a 6 index array containing the matrix you’re attempting to set.
Returns:

StyleJackTransformAPI()

StyleJackTransformAPI.Translate([_value])
Arguments:
  • _value (Array/String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. If this value is not an Array, nothing will happen. The value should be a 2 index array, representing x and y “$” as a value returns the raw value of the property. The values array should be numbers, which will become pixels
Returns:

StyleJackTransformAPI()

StyleJackTransformAPI.TranslateX([_value])
Arguments:
  • _value (String/Number) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property. The value passed in should be an number which will become a pixel offset
Returns:

StyleJackTransformAPI()

StyleJackTransformAPI.TranslateY([_value])
Arguments:
  • _value (String/Number) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property. The value passed in should be an number which will become a pixel offset
Returns:

StyleJackTransformAPI()

StyleJackTransformAPI.Scale([_value])
Arguments:
  • _value (Array/String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. If this value is not an Array, nothing will happen. The value should be a 2 index array, representing x and y “$” as a value returns the raw value of the property. The values array should be numbers, which will become a scale ratio
Returns:

StyleJackTransformAPI()

StyleJackTransformAPI.ScaleX([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property. The value passed in should be an number
Returns:

StyleJackTransformAPI()

StyleJackTransformAPI.ScaleY([_value])
Arguments:
  • _value (String/Number) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property. The value passed in should be an number
Returns:

StyleJackTransformAPI()

StyleJackTransformAPI.Rotate([_value])
Arguments:
  • _value (String/Number) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property. The value passed in should be an number, which will get converted to degrees
Returns:

StyleJackTransformAPI()

StyleJackTransformAPI.Skew([_value])
Arguments:
  • _value (Array/String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. If this value is not an Array, nothing will happen. The value should be a 2 index array, representing x and y “$” as a value returns the raw value of the property. The values passed in should be numbers, which will get converted to degrees
Returns:

StyleJackTransformAPI()

StyleJackTransformAPI.SkewX([_value])
Arguments:
  • _value (String/Number) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property. The value passed in should be an number, which will get converted to degrees
Returns:

StyleJackTransformAPI()

StyleJackTransformAPI.SkewY([_value])
Arguments:
  • _value (String/Number) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property. The value passed in should be an number, which will get converted to degrees
Returns:

StyleJackTransformAPI()

StyleJackTransformAPI.api
Returns:StyleJackAPI()

StyleJack Transition API

class StyleJackTransitionAPI()
StyleJackTransitionAPI.Get()

The object that’s returned has both numerical and string keys.

{
    0:property,1:duration,2:timing,3:delay,
    'property':property,
    'duration':duration,
    'timing':timing,
    'delay':delay
}
Returns:Object
StyleJackTransitionAPI.Set([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackTransitionAPI()

StyleJackTransitionAPI.Property([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackTransitionAPI()

StyleJackTransitionAPI.Duration([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackTransitionAPI()

StyleJackTransitionAPI.Timing([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackTransitionAPI()

StyleJackTransitionAPI.Delay([_value])
Arguments:
  • _value (String) – If no value passed in, returns the current value. Any value other than “$”, attempts to set the passed value to the property. “$” as a value returns the raw value of the property
Returns:

StyleJackTransitionAPI()

StyleJackTransitionAPI.api()
Returns:StyleJackAPI()

StyleJack FontFace API

The FontFace API will always return the API. It’s not designed to be used as a getter, only for creating font-face rules entirely in JavaScript. The rule will get initialized into the Stylesheet once both Family and Src are set. You do not have to call any method to “commit” the rule into the Stylesheet.
StyleJackFontFaceAPI.Family(_family)
Arguments:
  • _family (String) –
    The name of the font family that you’re registering. This can be any string, and provides the name that you access your font-face with (in a font-family in CSS or Font().Family() in StyleJack)
    returns:StyleJackFontFaceAPI()
StyleJackFontFaceAPI.Src(_src)
Arguments:
  • _src (String) –
    The src of your font. This can be pre-formatted as url(‘’) or the straight string. It doesn’t check for http, so data URIs work as well.
    returns:StyleJackFontFaceAPI()
StyleJackFontFaceAPI.Stretch(_stretch)
Arguments:
  • _stretch (String) –

    The stretch value that your font-face implements.

    Permissible Values: “normal”,”condensed”,”ultra-condensed”,”extra-condensed”,”semi-condensed”,”expanded”,”ultra-expanded”,”extra-expanded”,”semi-expanded”

Throws console.log:
 

Logs a message if you try to set an invalid value

returns:StyleJackFontFaceAPI()

StyleJackFontFaceAPI.Style(_style)
Arguments:
  • _style (String) –

    The font style that this font-face implements.

    Permissible Values: “normal”,”italic”,”oblique”

Throws console.log:
 

Logs a message if you try to set an invalid value :returns: StyleJackFontFaceAPI()

StyleJackFontFaceAPI.UnicodeRange(_unicodeRange)
Arguments:
  • _unicodeRange (String) –
    The unicode range that you want to use from the font file. This allows you to only import specific characters from a font into this custom font-family
    throws console.log:
     Logs a message if you try to set an invalid value
    returns:StyleJackFontFaceAPI()
StyleJackFontFaceAPI.Weight(_weight)
Arguments:
  • _weight (String/Number) –

    The font-weight for this font-family. This allows you to actually define what the weight of this @font-face is

    Permissible values: “normal”, “bold”, “lighter”, “bolder”, 100, 200, 300, 400, 500, 600, 700, 800, 900

Throws console.log:
 

Logs a message if you try to set an invalid value

returns:StyleJackFontFaceAPI()

StyleJack CSSKeyFrame API

StyleJackCSSKeyFrameAPI.Index(_index)

This is for inserting a new Keyframe at the given index. This returns the Stylejack representing the given index. Indexes should be 0-100 as they’re percentages along the animations duration.

Arguments:
  • _index (Number) –
    The percentage (0-100) of the animation where you want to create a new keyframe
    returns:StyleJackAPI()
StyleJackCSSKeyFrameAPI.Delete()

Deletes the Keyframe rule entirely.

Returns:Boolean Represents success/failure of removing the given keyframe rule.
StyleJackCSSKeyFrameAPI.Debug()
Returns:CSSKeyFramesRule Returns the raw DOM CSSKeyFramesRule object for debugging

Todo

StyleJack Method Implementation. These methods require implementation still.

StyleJackCSSKeyFrameAPI.Clear(_index)
StyleJackCSSKeyFrameAPI.Each()

Event Methods as well do nothing (Events are never emitted)