cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Change the styles like color , font-family in one click for the entire application

ranjank
14-Alexandrite

Change the styles like color , font-family in one click for the entire application

Hi Team,

 

Suppose I have a full working application(consisting of popups too) with various types of widgets present in application and I want to change the color, font-style etc type styles in one go with some custom logic or usig PTC api then how it can be achieved.

 

Is it possible. If yes, then share the logic.

 

Thanks in advance.

5 REPLIES 5
c_lowy
16-Pearl
(To:ranjank)

Hi @ranjank,

 

Style Themes are what was implemented in ThingWorx to achieve such results. They will allow you to define some styles that will then apply to all Themeable Widgets within the mashup that implements the Style Theme. Themeable Widgets are marked like this in the Mashup Builder :

 

ranjank
14-Alexandrite
(To:c_lowy)

@c_lowy 

I tried with the Style Theme but it applies only to Themeable Widgets (as you mentioned).

 

But our application consists of other widgets like Autocomplete, Tree, Autorefresh , popup title etc and many other widgets where Style themes didn't apply.

 

What should be done to change the styles like font-family, color etc for those widgets so that it should look in regard with other Themeable widgets (as application should be consistent throughout in terms of look and feel also).

 

Please help.

Hi @ranjank 

 

You can only change the style theme of the widgets which are themeable. In your use case, you can create a service which outputs the style theme you would like to apply(result type STYLETHEMENAME) which executes on button click. You can bind the output of the service to Style Theme property of either the mashup or widgets you would like to change. Then on button click the the new style theme should get applied. 

 

Regards,

Sachin

ranjank
14-Alexandrite
(To:SachinSharma)

@SachinSharma 

 

The point is Style Theme gets applied to only Themeable widgets and not to others whether by service or manually.

All non-themeable widgets does dispay Style Theme applied on composer but it never gets applied at run-time.

 

Then how to make the entire application consistent with respect to UI/UX because any application may not necessary having only Themeable widgets on the mashups as these are only 29 widgets in actual number.

nmilleson
17-Peridot
(To:ranjank)

@ranjank ,

 

If you are using a Master mashup, you can put all of your css code in there and it should apply to all of the child mashups.  Then if you want to change the look of the application, you can just change what custom class is bound to all of your widgets.  I've used session variables to manage that in the past and it works pretty well. 

 

-Nick

Top Tags