   styleEl      = document.createElement 'style'
   styleEl.type = 'text/css'
 
+  # Once the style buffer is ready, it's appended to the document as a stylesheet.
   if styleEl.styleSheet
     styleEl.styleSheet.cssText = styleBuffer
   else

      opt          = {}
      angle        = anchor = null

      switch fn.length
        when 1
          opt.callback = a0


'use strict'

# Utility Functions
# ================

# Used for informing the developer which required feature the browser lacks.
supportWarning = (prop) ->
  console?.warn "OriDomi: Missing support for `#{ prop }`."
  isSupported = false


# Checks for the presence of CSS properties on a test element.
testProp = (prop) ->
  # Loop through the vendor prefix list and return a match is found.
  for prefix in prefixList
    return full if testEl.style[(full = prefix + capitalize prop)]?

  # If the unprefixed property is present, return it.
  return prop if testEl.style[prop]?
  # If no matches are found, return false to denote that the browser is
  # missing this property.
  false


# Generates CSS text based on a selector string and a map of styling rules.
addStyle = (selector, rules) ->
  style = ".#{ selector }{"
  for prop, val of rules
    # If the CSS property is among special properties defined later, prefix it.
    if prop of css
      prop = css[prop]
      prop = '-' + prop if prop.match /^(webkit|moz|ms)/i

    # Convert camelcase to hypenated.
    style += "#{ prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase() }:#{ val };"

  styleBuffer += style + '}'


# Defines gradient directions based on a given anchor.
getGradient = (anchor) ->
  "#{ css.gradientProp }(#{ anchor }, rgba(0, 0, 0, .5) 0%, rgba(255, 255, 255, .35) 100%)"


# Used mainly when creating camelcased strings.
capitalize = (s) ->
  s[0].toUpperCase() + s[1...]


# Create an element and look up the canonical class name.
createEl = (className) ->
  el = document.createElement 'div'
  el.className = elClasses[className]
  el


# Clone an element, add an additional class, and return it.
cloneEl = (parent, deep, className) ->
  el = parent.cloneNode deep
  el.classList.add elClasses[className]
  el


# GPU efficient ways of hiding and showing elements:
hideEl = (el) ->
  el.style[css.transform] = 'translate3d(-9999px, 0, 0)'

