Just starting out? Need help? Post your questions and find answers here.
saboteur
 
Posts: 18
Joined: Mon Jan 08, 2018 10:25 am

CSS Stylesheet

by saboteur Fri Jun 28, 2019 10:31 am

Hi all,

Is there a list of all styles that can be set with SB. ?

I found some code that allows a custom style to be applied but without knowing what objects are called I can't define them all to my liking

e.g background color foreground color for particular gadget types

Also where is the default stylesheet that is used, as I want to change the background image : i tried changing it in the flat and aeroglass themes but this hasn't worked.

cheers
User avatar
Peter
 
Posts: 596
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1

Re: CSS Stylesheet

by Peter Fri Jun 28, 2019 2:16 pm

Besides the possibility to colorize the windows and gadgets with SetWindowColor() and SetGadgetColor(), there is the possibility to create your own CSS or to adapt an existing CSS to your needs (assuming you have the necessary knowledge).

The path for the Window-CSS is:
[PathTo]\SpiderBasic\Libraries\javascript\themes\

The path for the Gadget-CSS is:
[PathTo]\SpiderBasic\Libraries\javascript\dojo\themes\

It is best to copy an existing CSS folder and rename it.

In the compiler options you can select this folder after restarting the IDE.

Last, but not least: As a quick'n dirty hack it is also possible to inject your own CSS at runtime:

Code: Select all
! var style = "<style type='text/css'>" +
!             " html { background : green !important ;}" +
!             "</style>"
! $(style).appendTo("head");


Greetings ... Peter
Return to Coding Questions

Who is online

Users browsing this forum: No registered users and 1 guest