How to add CSS file to a WebLayout component

Forum to discuss the new web client version of Servoy.

How to add CSS file to a WebLayout component

Postby jasantana » Fri Aug 11, 2017 11:16 am

We know that we can add CSS or JS files references to WebComponents using the libraries property in the spec file.

I wonder how can we do that with the WebLayout components.

Thanks in advance.
User avatar
jasantana
 
Posts: 539
Joined: Tue Aug 10, 2010 11:40 am
Location: Leeds - West Yorkshire - United Kingdom

Re: How to add CSS file to a WebLayout component

Postby paronne » Fri Aug 11, 2017 11:31 am

Hi Juan,

you can add the CSS/JS reference in the MANIFEST of the WebLayout

CSS-DesignLibs: 12grid/lib/12grid_design.css
CSS-ClientLibs: 12grid/lib/12grid.css

(For javascript JS-DesignLibs/JS-ClientLibs )

Note you can have a CSS-DesignLibs which differ from CSS-ClientLibs. The design libs is used in the Form Designer, while client lib in the running client.
The reason for this is that you can add custom style to your layout so it can be better used in the Form Editor; for example we give a min height of 20px to all 12grid layout elements so the user can drop easily elements into it using the form editor.

Check our 12Grid layout https://github.com/Servoy/12grid/blob/m ... ANIFEST.MF
paronne
 
Posts: 80
Joined: Fri Nov 02, 2012 3:21 pm

Re: How to add CSS file to a WebLayout component

Postby jasantana » Fri Aug 11, 2017 11:38 am

Thanks Paolo !!
User avatar
jasantana
 
Posts: 539
Joined: Tue Aug 10, 2010 11:40 am
Location: Leeds - West Yorkshire - United Kingdom


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 2 guests