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

Use "Dark Editor Theme" as runtime theme

Discussion in 'UI Toolkit' started by jtiret, Aug 18, 2021.

  1. jtiret

    jtiret

    Joined:
    Nov 11, 2020
    Posts:
    63
    Hello there,

    Prior to updating to UIToolkit Preview16, I didn't have to use a .tss Theme asset. Since I updated, a default runtime theme, attached to the panel settings, have been created.

    The problem is that the default values set as part of this them somewhat break my UI documents. For example, there are default margin set on labels (that I didn't have before), the scroll bars are white, etc.

    In UI Builder, I can choose to visualize my documents using the default runtime theme, or using the "Dark Editor Theme". It looks like until a runtime theme was automatically created by updating to Preview16, all my UI was based on a default stylesheet corresponding to "Dark Editor Theme".

    Screenshot 2021-08-18 at 18.09.50.png

    The question is: Is there a way to use the "Dark Editor Theme" as a base/starting point for my default runtime theme?
    I searched in the UI Toolkit package directories but couldn't find anything like this.

    Thanks in advance for your help
     
  2. magnetic_scho

    magnetic_scho

    Joined:
    Feb 2, 2020
    Posts:
    69
    That's a good point. It took me quite some time as well figuring out, what changes to the default runtime theme were introduced with preview.15.

    Having the current runtime theme as a base that could be adjusted would be very good, or at least know what changed from preview.14 to preview.15.
     
  3. Daxten

    Daxten

    Joined:
    Sep 20, 2013
    Posts:
    30
    The Dark Theme is only available as a binary package and works different then *.tss files. Because of that they can't provide it without additional work to maintain it (which I guess might happen?)

    Short answer: no easy way to get that, and it only works with editor
     
  4. magnetic_scho

    magnetic_scho

    Joined:
    Feb 2, 2020
    Posts:
    69
    Actually, I don't care about the (Dark) Theme itself. Just knowing, what changed from preview.14 to preview.15 (e.g. Labels have some margin now), would be great, so that I don't have to fix most of my UI while doing the upgrade, but could just add some uss rules.

    I would see this as a part of the changelog, e.g:
    Changes to the default style:
    - Labels margin changed from 0 to x px.
    - ...
     
    influxus likes this.
  5. jtiret

    jtiret

    Joined:
    Nov 11, 2020
    Posts:
    63
    It would also be completely ok for me not to have the Dark Editor Theme but just a CSS extract of the prior default rules that I could just copy and paste into my default CSS file. Or as mentioned by @magnetic_scho a list of what changed.

    These kind of info should be mentioned in a change log indeed.
     
    influxus likes this.
  6. magnetic_scho

    magnetic_scho

    Joined:
    Feb 2, 2020
    Posts:
    69
    @jtiret
    I agree, to have the prior default USS rules would be perfect.
     
  7. Daxten

    Daxten

    Joined:
    Sep 20, 2013
    Posts:
    30
    I agree with you, but those rules never existed as USS, only in a binary format which was working at runtime as a side-effect. Because of that there is no easy way to extract them from our side :(

    Unity Dev said somewhere else they get created from a central repo for different apps, and they would need to add support for USS export there