You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -462,9 +460,7 @@ This will cause CSS created by the loader to take priority over CSS already pres
462
460
You can use other values if the standard behavior is not suitable for you, but we do not recommend doing this.
463
461
If you target an [iframe](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement) make sure you have sufficient access rights, the styles will be injected into the content document head.
464
462
465
-
#### `string`
466
-
467
-
##### `Selector`
463
+
#### `Selector`
468
464
469
465
Allows to setup custom [query selector](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector) where styles inject into the DOM.
470
466
@@ -491,7 +487,7 @@ module.exports = {
491
487
};
492
488
```
493
489
494
-
#####`Absolute path to function`
490
+
#### `Absolute path to function`
495
491
496
492
Allows to setup absolute path to custom function that allows to override default behavior and insert styles at any position.
A new `<style>`/`<link>` elements will be inserted into at bottom of `body` tag.
530
526
531
-
#### `function`
527
+
Examples:
532
528
533
-
Allows to override default behavior and insert styles at any position.
529
+
Insert styles at top of `head` tag:
534
530
535
-
> **Warning**
536
-
>
537
-
> Do not forget that this code will be used in the browser and not all browsers support latest ECMA features like `let`, `const`, `arrow function expression` and etc, we recommend use only ECMA 5 features, but it is depends what browsers you want to support
531
+
**insert-function.js**
538
532
539
-
> **Warning**
540
-
>
541
-
> Do not forget that some DOM methods may not be available in older browsers, we recommended use only [DOM core level 2 properties](https://caniuse.com/#search=DOM%20Core), but it is depends what browsers you want to support
533
+
```js
534
+
functioninsertAtTop(element) {
535
+
var parent =document.querySelector("head");
536
+
// eslint-disable-next-line no-underscore-dangle
537
+
var lastInsertedElement =window._lastElementInsertedByStyleLoader;
0 commit comments