@@ -45,13 +45,15 @@ const GlobalSettingsLoader = () => {
4545 */
4646 useEffect ( ( ) => {
4747 const editorBody = editorDom ?. closest ( 'body' )
48- if ( editorBody ) {
49- editorBody . appendChild ( globalTypographyWrapper )
50- editorBody . appendChild ( globalColorWrapper )
51- editorBody . appendChild ( globalSpacingAndBorderWrapper )
52- editorBody . appendChild ( globalButtonsAndIconsWrapper )
53- editorBody . appendChild ( globalColorSchemesWrapper )
54- editorBody . appendChild ( globalPresetControlsWrapper )
48+ const editorHead = editorBody ?. ownerDocument ?. head
49+
50+ if ( editorHead ) {
51+ editorHead . appendChild ( globalTypographyWrapper )
52+ editorHead . appendChild ( globalColorWrapper )
53+ editorHead . appendChild ( globalSpacingAndBorderWrapper )
54+ editorHead . appendChild ( globalButtonsAndIconsWrapper )
55+ editorHead . appendChild ( globalColorSchemesWrapper )
56+ editorHead . appendChild ( globalPresetControlsWrapper )
5557 }
5658 } , [ deviceType , editorDom ] )
5759
@@ -75,12 +77,12 @@ globalButtonsAndIconsWrapper?.setAttribute( 'id', 'stk-global-buttons-and-icons-
7577globalColorSchemesWrapper ?. setAttribute ( 'id' , 'stk-global-color-schemes-styles' )
7678globalPresetControlsWrapper ?. setAttribute ( 'id' , 'stk-global-preset-controls-styles' )
7779domReady ( ( ) => {
78- document ?. body ?. appendChild ( globalTypographyWrapper )
79- document ?. body ?. appendChild ( globalColorWrapper )
80- document ?. body ?. appendChild ( globalSpacingAndBorderWrapper )
81- document ?. body ?. appendChild ( globalButtonsAndIconsWrapper )
82- document ?. body ?. appendChild ( globalColorSchemesWrapper )
83- document ?. body ?. appendChild ( globalPresetControlsWrapper )
80+ document ?. head ?. appendChild ( globalTypographyWrapper )
81+ document ?. head ?. appendChild ( globalColorWrapper )
82+ document ?. head ?. appendChild ( globalSpacingAndBorderWrapper )
83+ document ?. head ?. appendChild ( globalButtonsAndIconsWrapper )
84+ document ?. head ?. appendChild ( globalColorSchemesWrapper )
85+ document ?. head ?. appendChild ( globalPresetControlsWrapper )
8486 createRoot ( globalTypographyWrapper ) . render ( < GlobalTypographyStyles /> )
8587 createRoot ( globalColorWrapper ) . render ( < GlobalColorStyles /> )
8688 createRoot ( globalSpacingAndBorderWrapper ) . render ( < GlobalSpacingAndBordersStyles /> )
0 commit comments