TWebMessageDlg - How to prevent element.styles when there are CSS classes set

I dynamically create TWebMessageDlg(s) and set the CSS classe to use like this:

 Result := TWebMessageDlg.Create(Application.MainForm);
 Result.ElementButtonClassName := 'ConfirmDlgButton';
 Result.ElementDialogClassName := 'ConfirmDlgDialog';
 Result.ElementTitleClassName := 'ConfirmDlgTitle';
 Result.ElementContentClassName := 'ConfirmDlgContent';

The resulting HTML indeed uses the assigned classes but also still puts tons of styles directly in the respective elements, e.g. the background color, such that the settings in the classes get overwritten.

How to prevent this?

What is "tons of styles"?
Everything I test works here.
Test project: (5.4 KB)

If e.g. in the sample you set a background color in class "dlg" like this

      .dlg { background-color: grey;}
      .dlgtitle { background-color: red;}
      .dlgcontent { background-color: yellow;}

it gets overwritten with the element, where amongst a tons of other style settings in particular "background-color" is overwritten with "white".



Extended sample that shows this: (6.6 KB)

We improved applying ElementDialogClassName.
Next update will have this improvement.