No Description

style-inject.es-dcee06b6.js 741B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict';
  2. function styleInject(css, ref) {
  3. if ( ref === void 0 ) ref = {};
  4. var insertAt = ref.insertAt;
  5. if (!css || typeof document === 'undefined') { return; }
  6. var head = document.head || document.getElementsByTagName('head')[0];
  7. var style = document.createElement('style');
  8. style.type = 'text/css';
  9. if (insertAt === 'top') {
  10. if (head.firstChild) {
  11. head.insertBefore(style, head.firstChild);
  12. } else {
  13. head.appendChild(style);
  14. }
  15. } else {
  16. head.appendChild(style);
  17. }
  18. if (style.styleSheet) {
  19. style.styleSheet.cssText = css;
  20. } else {
  21. style.appendChild(document.createTextNode(css));
  22. }
  23. }
  24. exports.styleInject = styleInject;
  25. //# sourceMappingURL=style-inject.es-dcee06b6.js.map