This is a companion discussion topic for the original entry at https://blog.ironmansoftware.com/powershell-universal-themes/
Hi @adam
Sorry to dig up this old post again, but I’m not really getting anywhere with this topic at the moment.
Are there any instructions on how to use the themes and create new ones using the json logic from @potatoqualitee ?
So i made my progress with it, but most of the documentation is not correct anymore or the official documentation about themes and css does not cover the part with the themes from Chrissy.
My progress so far. I have made a theme switcher available for my users in the HeaderOptions (rinning at latest v4):
Questions:
Get-UDTheme -Current
only gives me the current light/dark as values. Is their any native way of getting the current selected theme? (in my example it is ‘Lab Fox’, to display this as default value in my select box. It should dynamically adjust if a user selects a new one, so i wanted to useGet-UdTheme -Current
). I have usedNew-UDApp -Theme
to add a default theme but i want it during runtime.- How do i add my own themes using the logic from your post? Quote from your linked post above: “You can create your own themes by adding JSON files to the theme folder.”. Is this still working? where is the theme folder located? i have place a folder “theme” (tried also “themes”) in the root of my dashboard/app folder containing my adjusted json file, but the new theme will not be recognized
- Do i need any or all of the code and functions from Chrissy’s repository? I also cannot find the
Get-Colors
integrated in psu if i want to use it by myself. Of course I could pull the code from Chrissy, customize it and use it for myself, but since you have already integrated the complete themes, I hope that works with it :). - And is there a way to customize the Built-In Themes? For example, if I want to change colors of specific elements, fonts, font sizes, etc.? Or do I have to create a new theme and custom stylesheets for this? Of course related to the Built-In Themes from Chrissy. I know how to create and customize themes in Universal in general.
As you can see, I’m still a bit confused because I don’t quite understand how I can make customizations with just a JSON file.
EDIT: i found a themes
folder located in the universal installation directory Modules\Universal\themes
where all themes are located. Should i add mine to this folder? I find this variant a bit unattractive, as I have to copy the file there again with every update (as we currently do updates). Couldn’t this be integrated natively in the repository folder under “themes” or similar?
EDIT2: It works by copying my custom json file to Modules\Universal\themes
, my new theme then appears, but is this the right way?
Thanks for your help