@@ -2153,19 +2153,17 @@ function RemoteFunctions(config = {}) {
21532153 // if element is non-editable we use gray bg color in info box, otherwise normal blue color
21542154 const bgColor = this . element . hasAttribute ( GLOBALS . DATA_BRACKETS_ID_ATTR ) ? '#4285F4' : '#3C3F41' ;
21552155
2156- // we need to insert some dynamic values in the info box styles
2157- const styles = `
2156+ // add everything to the shadow box with CSS variables for dynamic values
2157+ shadow . innerHTML = `
21582158 <style>
21592159 ${ config . styles . infoBox }
21602160 :host {
21612161 --info-box-bg-color: ${ bgColor } ;
21622162 --info-box-left-pos: ${ leftPos } px;
21632163 }
21642164 </style>
2165+ <div class="phoenix-node-info-box">${ content } </div>
21652166 ` ;
2166-
2167- // add everything to the shadow box
2168- shadow . innerHTML = `<style>${ styles } </style><div class="phoenix-node-info-box">${ content } </div>` ;
21692167 this . _shadow = shadow ;
21702168 } ,
21712169
@@ -4158,43 +4156,17 @@ function RemoteFunctions(config = {}) {
41584156 const overlay = window . document . createElement ( 'div' ) ;
41594157 overlay . setAttribute ( GLOBALS . PHCODE_INTERNAL_ATTR , 'true' ) ;
41604158
4161- const styles = `
4162- <style>
4163- .phoenix-dialog-overlay {
4164- position: fixed !important;
4165- top: 0 !important;
4166- left: 0 !important;
4167- width: 100% !important;
4168- height: 100% !important;
4169- background: rgba(0, 0, 0, 0.5) !important;
4170- z-index: 2147483646 !important;
4171- pointer-events: auto !important;
4172- }
4173-
4174- .phoenix-dialog-message-bar {
4175- position: absolute !important;
4176- top: 50% !important;
4177- left: 50% !important;
4178- transform: translate(-50%, -50%) !important;
4179- color: #ffffff !important;
4180- background-color: #333333 !important;
4181- padding: 1em 1.5em !important;
4182- text-align: center !important;
4183- font-size: 16px !important;
4184- border-radius: 3px !important;
4185- font-family: "SourceSansPro", Helvetica, Arial, sans-serif !important;
4186- z-index: 2147483647 !important;
4187- }
4188- </style>
4189- ` ;
4159+ // use shadow DOM for style isolation
4160+ const shadow = overlay . attachShadow ( { mode : 'open' } ) ;
4161+ const styles = config . styles . dialogOverlay ;
41904162
41914163 const content = `
41924164 <div class="phoenix-dialog-overlay">
41934165 <div class="phoenix-dialog-message-bar">${ config . strings . imageGalleryDialogOverlayMessage } </div>
41944166 </div>
41954167 ` ;
41964168
4197- overlay . innerHTML = styles + content ;
4169+ shadow . innerHTML = `<style> ${ styles } </style> ${ content } ` ;
41984170 window . document . body . appendChild ( overlay ) ;
41994171 _dialogOverlay = overlay ;
42004172 }
@@ -5235,42 +5207,7 @@ function RemoteFunctions(config = {}) {
52355207 toast . setAttribute ( GLOBALS . PHCODE_INTERNAL_ATTR , "true" ) ;
52365208 const shadow = toast . attachShadow ( { mode : 'open' } ) ;
52375209
5238- const styles = `
5239- :host {
5240- all: initial !important;
5241- }
5242-
5243- .toast-container {
5244- position: fixed !important;
5245- bottom: 30px !important;
5246- left: 50% !important;
5247- transform: translateX(-50%) translateY(0) !important;
5248- background-color: rgba(51, 51, 51, 0.95) !important;
5249- color: white !important;
5250- padding: 10px 14px !important;
5251- border-radius: 6px !important;
5252- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
5253- font-family: Arial, sans-serif !important;
5254- font-size: 13px !important;
5255- line-height: 1.4 !important;
5256- z-index: 2147483647 !important;
5257- text-align: center !important;
5258- max-width: 90% !important;
5259- box-sizing: border-box !important;
5260- animation: slideUp 0.3s ease-out !important;
5261- }
5262-
5263- @keyframes slideUp {
5264- from {
5265- opacity: 0;
5266- transform: translateY(20px);
5267- }
5268- to {
5269- opacity: 1;
5270- transform: translateY(0);
5271- }
5272- }
5273- ` ;
5210+ const styles = config . styles . toastMessage ;
52745211
52755212 const content = `
52765213 <div class="toast-container">
0 commit comments