@Import css

Forum to discuss the new web client version of Servoy.

@Import css

Postby Gordon McLean » Wed Nov 22, 2017 1:09 pm

Hi

I am using trying to split up a large css file as I need to use the graphics section in other projects. I have used @import and whilst the font imports fine the graphics.css file is not found. I have checked the path and the file seems to exist and separately I can see it in the media folder in Servoy developer. Can I just check that this is in fact the way you import separated css files into the main css for a solution.

Code: Select all
@import url("graphics.css");
@import url('https://fonts.googleapis.com/css?family=Monseratt:400,400i,700,700i');


Many thanks
Gordon
Gordon McLean
Clickdigital.com
Gordon McLean
 
Posts: 207
Joined: Wed Aug 03, 2005 12:24 pm
Location: UK

Re: @Import css

Postby paronne » Wed Nov 22, 2017 1:31 pm

Hi,

the way to import separate css is fine. The URL in import will use the relative path within the media folder.
I assume you have a main .css file which is linked to your solution (or any of your solution's module) using the "styleSheet" solution's property.

I imagine you have the following structure in the media folder:

Media
- yourmain.css
- graphics.css

Do you have any error in the browser console like: "cannot find graphics.css"

Note, from the next Servoy release, 8.2.2 you should add a "tag" to the css imported via url; the tag will make sure that the client doesn't reuse old cached css.
See the section 3. Importing other .css files in the main solution .css in the wiki https://wiki.servoy.com/display/DOCS/St ... e+NGClient
paronne
 
Posts: 107
Joined: Fri Nov 02, 2012 3:21 pm

Re: @Import css

Postby Gordon McLean » Wed Nov 22, 2017 2:51 pm

Hi Paolo

Thanks for your reply, the graphics.css file was in the correct place but for some reason not registering in the browser ie I got a missing file notification in the console. I rebooted the developer and this appears to have cleared up the problem which is now working :)

The tag in the imported file - where do you get the timestamp from I am presuming this has to match the file you are trying to import exactly ?

Many thanks
Gordon
Gordon McLean
Clickdigital.com
Gordon McLean
 
Posts: 207
Joined: Wed Aug 03, 2005 12:24 pm
Location: UK

Re: @Import css

Postby paronne » Wed Nov 22, 2017 3:03 pm

Hi Gordon,

the tag will be automatically replaced by Servoy (from 8.2.2, not yet !!) when you will generate a WAR.
Just add the tag exactly as described in the wiki.
paronne
 
Posts: 107
Joined: Fri Nov 02, 2012 3:21 pm

Re: @Import css

Postby Gordon McLean » Wed Nov 22, 2017 4:22 pm

OK thanks will add the tag.

Interestingly when the graphics.css @import worked it did not refresh the tree in the properties panel ie the elements of graphics.css are not listed in the css helper. However if you manually add one of the graphics.css elements to the css of the form it correctly works. Its as if Servoy is not parsing this @imported file - maybe this is intended, however it would be nice if it recognised the import

Cheers
Gordon
Gordon McLean
Clickdigital.com
Gordon McLean
 
Posts: 207
Joined: Wed Aug 03, 2005 12:24 pm
Location: UK


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 5 guests

cron