From 0eb8fe71b81ea554e84fca719b5661f67047b256 Mon Sep 17 00:00:00 2001 From: Alexey Date: Fri, 26 Jan 2018 21:41:14 +0300 Subject: [PATCH] feat: support passing a `{Function}` (`options.insertInto`) (#279) --- README.md | 19 ++++++++++++++++--- index.js | 23 +++++++++++++++++++---- lib/addStyles.js | 28 +++++++++++++++++++--------- options.json | 3 --- test/basicTest.js | 20 +++++++++++++++++++- test/insert/into.js | 3 +++ 6 files changed, 76 insertions(+), 20 deletions(-) create mode 100644 test/insert/into.js diff --git a/README.md b/README.md index 3cece161..1b00712e 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,7 @@ Styles are not added on `import/require()`, but instead on call to `use`/`ref`. |**`attrs`**|`{Object}`|`{}`|Add custom attrs to ``| |**`transform`** |`{Function}`|`false`|Transform/Conditionally load CSS by passing a transform/condition function| |**`insertAt`**|`{String\|Object}`|`bottom`|Inserts `` at the given position| -|**`insertInto`**|`{String}`|``|Inserts `` into the given position| +|**`insertInto`**|`{String|Function}`|``|Inserts `` into the given position| |**`singleton`**|`{Boolean}`|`undefined`|Reuses a single `` element, instead of adding/removing individual elements for each required module.| |**`sourceMap`**|`{Boolean}`|`false`|Enable/Disable Sourcemaps| |**`convertToAbsoluteUrls`**|`{Boolean}`|`false`|Converts relative URLs to absolute urls, when source maps are enabled| @@ -318,14 +318,27 @@ A new `