   #   LESS file in the stylesheets path.
   #
   # Returns the absolute path to the stylesheet
-  requireStylesheet: (stylesheetPath) ->
+  requireStylesheet: (stylesheetPath, ttype = 'bundled', htmlElement) ->
     if fullPath = @resolveStylesheet(stylesheetPath)
       content = @loadStylesheet(fullPath)
-      @applyStylesheet(fullPath, content)
+      @applyStylesheet(fullPath, content, ttype = 'bundled', htmlElement)
     else
       throw new Error("Could not find a file at path '#{stylesheetPath}'")
 

      @requireStylesheet(nativeStylesheetPath)

  # Internal-only:
  stylesheetElementForId: (id) ->
    $("""head style[id="#{id}"]""")

  # Internal-only:
  resolveStylesheet: (stylesheetPath) ->

    @stylesheetElementForId(@stringToId(fullPath)).remove()

  # Internal-only:
  applyStylesheet: (path, text, ttype = 'bundled', htmlElement=$('html')) ->
    styleElement = @stylesheetElementForId(@stringToId(path), htmlElement)
    if styleElement.length
      styleElement.text(text)
    else
      if htmlElement.find("head style.#{ttype}").length
        htmlElement.find("head style.#{ttype}:last").after "<style class='#{ttype}' id='#{@stringToId(path)}'>#{text}</style>"
      else
        htmlElement.find("head").append "<style class='#{ttype}' id='#{@stringToId(path)}'>#{text}</style>"
