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.CreateInitialize;
 Result....
 Result....
 Result....
 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: Project2.zip (5.4 KB)

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

    <style>
      .dlg { background-color: grey;}
      .dlgtitle { background-color: red;}
      .dlgcontent { background-color: yellow;}
    </style>

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

grafik

grafik

Extended sample that shows this:
Test4.zip (6.6 KB)

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