Skip to content

Commit

Permalink
Minor fix to createInlineStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Jan 7, 2024
1 parent 2874e8a commit 0dbf8f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion components/lib/utils/DomHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1067,10 +1067,15 @@ export default class DomHandler {
return false;
}

static createInlineStyle(nonce, styleContainer = document.head) {
static createInlineStyle(nonce, styleContainer) {
let styleElement = document.createElement('style');

DomHandler.addNonce(styleElement, nonce);

if (!styleContainer) {
styleContainer = document.head;
}

styleContainer.appendChild(styleElement);

return styleElement;
Expand Down

0 comments on commit 0dbf8f0

Please sign in to comment.