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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Need to use style ctx in custom css for changing font-size of a button

VK_10159720
8-Gravel

Need to use style ctx in custom css for changing font-size of a button

HI Team,

I have a button on which I gave custom class and using root of it, I am able to change its background color, but I am unable to change font-size of that button.

I tried to change it via many things, but its only changing when I am expanding #shadow-root (open) and changing value under <style ctx="PTC-BUTTON.danger"> [part~=label] {

font-size: 18px}

I am not able to use it in custom css as I am not aware how to use ctx in custom css.

Can anyone please guide me on it?

 

My current css is:

.classqa, #root_ptcsbutton-150{

background: #d91717

}

 

6 REPLIES 6

Hello @VK_10159720 

 

Pls check the following article, In this you may find the solution:

 

https://www.ptc.com/en/support/article/cs322901

 

Thanks

Bhawna

jensc
17-Peridot
(To:VK_10159720)

Hello,

 

There is no need to do this using CSS, you can change the background color and font size of the text using the built in functionality.

This is also the recommended way by PTC.

 

Background color:

jensc_0-1680242809428.png

Font size:

jensc_1-1680242834405.png

 

Perhaps if you use a lower version of Thingworx this might not be possible. But if I remember correctly it should at least be possible from 9.1.

 

Regards,

Jens

HI @jensc,

 

It is not picking mentioned font-size in style properties as per your suggestion. It is displaying some different values. I even tried to remove style theme as well, but didn't help. but if i refresh the mashup in runtime, then it takes correct value as specified in style properties.

That is why I had to change via css. 

Hello @VK_10159720 , 

 

Have you tried the shared article?

If that is not providing the expected solution. In my opinion, pls open a case with Tech support team.

 

Thanks

Bhawna

jensc
17-Peridot
(To:VK_10159720)

Hello @VK_10159720 

 

Alright, I think I have seen that sometime before as well, although for my case it was in a list.

For me it was something in the Style Theme that I had to change.

 

But if the out of the box functionality is not working for you as it should, I would as @bchaudhary is saying, open a case with PTC to figure it out.

 

Regards,

Jens

Thanks both. Will Check with PTC.

I tried multiple things using above article but it keeps on giving error.

Top Tags