source: frontend/node_modules/style-loader/dist/runtime/styleDomAPI.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.5 KB
Line 
1"use strict";
2
3/* istanbul ignore next */
4function apply(styleElement, options, obj) {
5 var css = "";
6 if (obj.supports) {
7 css += "@supports (".concat(obj.supports, ") {");
8 }
9 if (obj.media) {
10 css += "@media ".concat(obj.media, " {");
11 }
12 var needLayer = typeof obj.layer !== "undefined";
13 if (needLayer) {
14 css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
15 }
16 css += obj.css;
17 if (needLayer) {
18 css += "}";
19 }
20 if (obj.media) {
21 css += "}";
22 }
23 if (obj.supports) {
24 css += "}";
25 }
26 var sourceMap = obj.sourceMap;
27 if (sourceMap && typeof btoa !== "undefined") {
28 css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
29 }
30
31 // For old IE
32 /* istanbul ignore if */
33 options.styleTagTransform(css, styleElement, options.options);
34}
35function removeStyleElement(styleElement) {
36 // istanbul ignore if
37 if (styleElement.parentNode === null) {
38 return false;
39 }
40 styleElement.parentNode.removeChild(styleElement);
41}
42
43/* istanbul ignore next */
44function domAPI(options) {
45 if (typeof document === "undefined") {
46 return {
47 update: function update() {},
48 remove: function remove() {}
49 };
50 }
51 var styleElement = options.insertStyleElement(options);
52 return {
53 update: function update(obj) {
54 apply(styleElement, options, obj);
55 },
56 remove: function remove() {
57 removeStyleElement(styleElement);
58 }
59 };
60}
61module.exports = domAPI;
Note: See TracBrowser for help on using the repository browser.