Search Unity

Using Editor Default Resources - Only Dark Theme? (bug?)

Discussion in 'UI Toolkit' started by BinaryCats, Sep 15, 2019.

  1. BinaryCats

    BinaryCats

    Joined:
    Feb 8, 2016
    Posts:
    317
    Hi,

    I want to override the behaviour of a textfield So that its
    backgroundImage
    is none, unless its pseudo state is hover, or selected.

    UXML:
    Code (CSharp):
    1.             <engine:TextField text="This is a title" class="h1"  name = "Title"/>
    2.  
    USS:
    Code (CSharp):
    1. .h1>#unity-text-input
    2. {
    3.     background-image: none;
    4. }
    5. .h1>#unity-text-input:hover
    6. {
    7.     background-image: resource("TextField.png");
    8. }
    9. .h1>#unity-text-input:focus
    10. {
    11.     background-image: resource("TextField focused.png");
    12. }
    This all works fine:
    upload_2019-9-15_19-44-20.png
    upload_2019-9-15_19-44-42.png
    upload_2019-9-15_19-45-10.png

    However, as you can see, this is much darker than Unity's Light theme Text Field:
    upload_2019-9-15_19-48-25.png

    I gathered the resource name, by inspecting the TextField element, and clicking on the
    backgroundImage
    field:
    upload_2019-9-15_19-52-48.png


    Why is this happening, shouldn't loading a Unity Default Resource load the resource for the version of unity (pro/non-pro) the user is using?

    Any help will be much appreciated!
     
  2. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    Hi, I would expect the resource of the currently loaded skin to be used, but it seems that the stylesheet resource loader ignores the skin at the moment. Can you please file a bug? That would be really appreciated. (Help > Report a Bug...)