diff --git a/src/resources/resources_css.js b/src/resources/resources_css.js index 8aa34403971..f114562763d 100644 --- a/src/resources/resources_css.js +++ b/src/resources/resources_css.js @@ -22,6 +22,17 @@ pc.extend(pc, function () { } }; + /** + * @function + * @name pc.createStyle + * @description Creates a <style> DOM element from a string that contains CSS + * @param {string} cssString A string that contains valid CSS + * @example + * var css = 'body {height: 100;}'; + * var style = pc.createStyle(css); + * document.head.appendChild(style); + * @return {Element} The style DOM element + */ var createStyle = function (cssString) { var result = document.createElement('style'); result.type = 'text/css';