CSS changes not reflicting inside the Modal

GhitaB
Tera Contributor

i'm trying to style one message inside a modal pop up in the service scriptbut seems like the changes are not reflicting

CUSTOM_MESSAGE:"<p class='custom-msg' please use this <a href='google.com'>Link</a></p>",

and in the controller this is what i have:

	var modalParam = {
			message: $sce.trustAsHtml($scope.data.i18n.CUSTOM_MESSAGE_ISOLV),
			
		};

 

.custom-msg {
color: red !important;
}

 

how can i let the changes to be visible on the modal.

1 ACCEPTED SOLUTION

MaxMixali
Mega Sage

Verification:

  1. Modal rendering context: spModal renders in a separate DOM context outside the widget's scope
  2. CSS isolation: Widget CSS is scoped and won't apply to modal content
  3. Actual solution needed: Inline styles in the HTML string itself

Correct solution:

 
 
javascript
CUSTOM_MESSAGE: "<p style='color: red;'>please use this <a href='google.com'>Link</a></p>",

The modal content is rendered outside your widget's CSS scope, so you must use inline styles directly in the HTML string. Widget CSS classes won't apply to spModal content.   Hope that can Help

View solution in original post

5 REPLIES 5

GhitaB
Tera Contributor

i ve tried it but it didn t work as well