Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How can I change the color of a Textfield?

Discussion in 'UI Toolkit' started by MaxHerrmann, Jan 7, 2023.

  1. MaxHerrmann

    MaxHerrmann

    Joined:
    Mar 11, 2020
    Posts:
    28
  2. C-UITools

    C-UITools

    Unity Technologies

    Joined:
    Jun 23, 2021
    Posts:
    22
    Hello,

    You had the right idea! But the
    .
    syntax is for class selectors. If you want to use a Type selector (meaning you want the style changes to happen to any VE with that type in your UXML document), simply use the Type name without a
    .
    as follows:

    Code (CSharp):
    1. TextInput {
    2. /* your changes */
    3. }
    For more info, see: Unity - Manual: USS selectors (unity3d.com)
    Hope this helps!
     
    MaxHerrmann likes this.
  3. MaxHerrmann

    MaxHerrmann

    Joined:
    Mar 11, 2020
    Posts:
    28
    Thank you so much!
     
    C-UITools likes this.