Jump to content

How to change ServerModule CustomCSS at run-time?


newsanti

Recommended Posts

constructor TMainmForm.Create(AOwner: TComponent);
begin
  inherited;
  with UniServerModule.CustomCSS do
  begin
    Add('.Round1 {');
    Add(' border-radius: 50px;');
    Add('}');
  end;
  TUniLayoutConfig(Panel1.LayoutConfig).Cls:= 'Round1';
end;
Not work!

Link to comment
Share on other sites

1 hour ago, newsanti said:

with UniServerModule.CustomCSS do
  begin
    Add('.Round1 {');
    Add(' border-radius: 50px;');
    Add('}');
  end;
  TUniLayoutConfig(Panel1.LayoutConfig).Cls:= 'Round1';

These codes work.

But this is not a fact that your CustomCSS will work correctly.

Link to comment
Share on other sites

Try this:

constructor TMainForm.Create(AOwner: TComponent);
begin
  inherited;
  with UniServerModule.CustomCSS do
  begin
    Add('.round1 .x-panel-body {');
    Add('   border-radius: 50px;');
    Add('}');
  end;
  TUniLayoutConfig(UniPanel1.LayoutConfig).Cls:= 'round1';
end;

 

Link to comment
Share on other sites

9 hours ago, Sherzod said:

Try this:

constructor TMainForm.Create(AOwner: TComponent);
begin
  inherited;
  with UniServerModule.CustomCSS do
  begin
    Add('.round1 .x-panel-body {');
    Add('   border-radius: 50px;');
    Add('}');
  end;
  TUniLayoutConfig(UniPanel1.LayoutConfig).Cls:= 'round1';
end;

 

work.. if code with servermodule.create and mainmodule.create.

not work (round3) if code with mainm.create.

How to customize css in form at run-time ? (Update MainPain CSS at run-time)

it work only refresh browser again. (After add CSS to ServerModule.CustomCSS>>work only new MainPage)

runtimeCSS.zipimage.png.4b8a902c785deb93f1a08f39f3831137.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...