Skip to main content
13-Aquamarine
July 26, 2023
Solved

how to apply custom css on textfield textarea background-color.

  • July 26, 2023
  • 1 reply
  • 2554 views

Hrishab108_0-1690336563033.png

how to apply custom css on textfield textarea background-color.

 

 

Best answer by Velkumar

Hi @Hrishabh.Sharma 

 

You can dynamically change the StyleTheme property value based on your use case using an expression.

 

Velkumar_0-1690436917524.png 

 

Velkumar_1-1690436970096.png

 

The reason why I'm insisting to use StyleTheme. In the recent Thingworx upgrade, PTC changed CSS Syntax which does not support custom CSS values - Solved: Custom CSS new syntax for specific button - PTC Community

 

If you still want to use custom CSS you can use the old syntax 

 

.myCustomClass ptcs-textfield::part(text-box){
 background : #000000
}

 

/VR

 

 

1 reply

19-Tanzanite
July 26, 2023

Hi @Hrishabh.Sharma 

 

You can change the text area color in Style Properties 

 

Velkumar_0-1690353608958.png

 

Do you have any specific reason to use custom CSS ?

 

/VR

 

13-Aquamarine
July 27, 2023

Hello @Velkumar ,
thanks!
I know that but i want to apply style definition on textarea by expression using create custom class inputs.
So, I need yaa, How to do this by custom css in thingworx.

Thank you
BR,
Hrishabh Sharma

Velkumar19-TanzaniteAnswer
19-Tanzanite
July 27, 2023

Hi @Hrishabh.Sharma 

 

You can dynamically change the StyleTheme property value based on your use case using an expression.

 

Velkumar_0-1690436917524.png 

 

Velkumar_1-1690436970096.png

 

The reason why I'm insisting to use StyleTheme. In the recent Thingworx upgrade, PTC changed CSS Syntax which does not support custom CSS values - Solved: Custom CSS new syntax for specific button - PTC Community

 

If you still want to use custom CSS you can use the old syntax 

 

.myCustomClass ptcs-textfield::part(text-box){
 background : #000000
}

 

/VR